/* ==========================================================================
   BPPIM · Sistema visual institucional
   Secretaría de Planeación – Alcaldía de Bucaramanga
   ========================================================================== */
:root {
  --g950: #062616;
  --g900: #0b3d26;
  --g800: #0f5132;
  --g700: #146c43;
  --g600: #1e7a4c;
  --g500: #2e9563;
  --g300: #8cc9a6;
  --g200: #c3e3cf;
  --g100: #e8f3ec;
  --g50:  #f4f9f6;
  --gold: #b8912f;
  --gold-l: #d8b45a;
  --gold-50: #fbf6e8;

  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --border: #e1e8e4;
  --border-strong: #cdd8d2;
  --text: #13231b;
  --text-2: #4b5b53;
  --muted: #7b8a82;

  --red: #d03b3b;   --red-50: #fdeeee;
  --amber: #d99a06; --amber-50: #fff6e0;
  --green: #1f9150; --green-50: #e7f6ed;
  --grey: #98a39d;  --grey-50: #f0f2f1;
  --blue: #2a6fc4;  --blue-50: #eaf2fc;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(11, 61, 38, .06), 0 1px 3px rgba(11, 61, 38, .05);
  --shadow: 0 4px 16px rgba(11, 61, 38, .07), 0 1px 3px rgba(11, 61, 38, .05);
  --shadow-lg: 0 24px 60px rgba(6, 38, 22, .22);
  --sidebar-w: 264px;
  --topbar-h: 68px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
a { color: var(--g700); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--g900) 0%, var(--g950) 100%);
  color: #dcebe2;
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  z-index: 40;
  transition: transform .25s ease;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--g600), var(--g800));
  border: 1px solid rgba(216,180,90,.55);
  display: grid; place-items: center;
  font-weight: 800; color: var(--gold-l); font-size: 15px; letter-spacing: .02em;
}
.brand-title { font-weight: 800; color: #fff; font-size: 16px; letter-spacing: .04em; }
.brand-sub { font-size: 11px; color: #9fc2ad; line-height: 1.3; }
.nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #7fa48e; padding: 14px 12px 6px; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 2px 0;
  border-radius: 10px;
  color: #cfe2d6; font-weight: 500;
  text-decoration: none;
  position: relative;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--gold-l);
}
.nav .count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--red); color: #fff; border-radius: 999px; padding: 1px 7px;
}
.sidebar-foot { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11px; color: #86a893; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 30;
}
.menu-toggle { display: none; }
.search-global { position: relative; flex: 1; max-width: 560px; }
.search-global input {
  width: 100%; height: 42px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2);
  padding: 0 14px 0 42px;
  outline: none;
}
.search-global input:focus { border-color: var(--g500); background: #fff; box-shadow: 0 0 0 4px rgba(46,149,99,.12); }
.search-global > svg { position: absolute; left: 14px; top: 12px; color: var(--muted); }
.search-global kbd {
  position: absolute; right: 10px; top: 10px;
  font-size: 11px; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; color: var(--muted); background: #fff;
}
.search-results {
  position: absolute; top: 48px; left: 0; right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); max-height: 460px; overflow-y: auto; z-index: 60;
  padding: 6px;
}
.search-results .group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 4px; font-weight: 700; }
.search-results .item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.search-results .item:hover, .search-results .item.focus { background: var(--g50); }
.search-results .item .t { font-weight: 600; }
.search-results .item .s { font-size: 12px; color: var(--muted); }
.search-results .empty { padding: 16px; text-align: center; color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 5px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff; cursor: pointer;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--g100); color: var(--g800);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.avatar.lg { width: 64px; height: 64px; font-size: 22px; border-radius: 18px; background: linear-gradient(135deg, var(--g600), var(--g800)); color: #fff; }
.user-chip .n { font-weight: 600; font-size: 13px; line-height: 1.1; }
.user-chip .r { font-size: 11px; color: var(--muted); }

.content { padding: 28px; max-width: 1560px; width: 100%; margin: 0 auto; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; color: var(--g900); }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }

.hero {
  position: relative; overflow: hidden;
  border-radius: 20px;
  background: radial-gradient(1200px 300px at 85% -40%, rgba(216,180,90,.28), transparent 60%),
              linear-gradient(120deg, var(--g900) 0%, var(--g700) 100%);
  color: #fff;
  padding: 28px 32px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 320px; height: 320px;
  border-radius: 50%; border: 36px solid rgba(255,255,255,.05);
}
.hero .eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-l); font-weight: 700; }
.hero h1 { font-size: 28px; font-weight: 800; margin-top: 6px; }
.hero p { margin: 6px 0 0; color: #cfe6d8; font-size: 15px; }
.hero .hero-meta { display: flex; gap: 22px; margin-top: 18px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .hero-meta div { font-size: 12px; color: #b8d6c4; }
.hero .hero-meta b { display: block; font-size: 15px; color: #fff; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 15px; font-weight: 700; color: var(--g900); display: flex; gap: 8px; align-items: center; }
.card-head .sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.mb { margin-bottom: 18px; }
.mt { margin-top: 18px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 14px; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
  position: relative; overflow: hidden;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--g200); }
.kpi .ic {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--g100); color: var(--g700); margin-bottom: 10px;
}
.kpi .ic svg { width: 17px; height: 17px; }
.kpi .v { font-size: 26px; font-weight: 800; color: var(--g900); line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; color: var(--text-2); margin-top: 6px; font-weight: 500; }
.kpi.primary { background: linear-gradient(135deg, var(--g800), var(--g600)); border-color: transparent; }
.kpi.primary .v, .kpi.primary .l { color: #fff; }
.kpi.primary .ic { background: rgba(255,255,255,.14); color: var(--gold-l); }
.kpi.danger .ic { background: var(--red-50); color: var(--red); }
.kpi.danger .v { color: var(--red); }
.kpi.warn .ic { background: var(--amber-50); color: var(--amber); }
.kpi.gold .ic { background: var(--gold-50); color: var(--gold); }
.kpi.blue .ic { background: var(--blue-50); color: var(--blue); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--border-strong);
  background: #fff; color: var(--text); font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap; text-decoration: none !important;
}
.btn:hover { background: var(--g50); border-color: var(--g300); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(46,149,99,.2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--g700); border-color: var(--g700); color: #fff; }
.btn-primary:hover { background: var(--g800); border-color: var(--g800); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: #a07c24; border-color: #a07c24; }
.btn-danger { background: #fff; border-color: #efc4c4; color: var(--red); }
.btn-danger:hover { background: var(--red-50); border-color: var(--red); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--g50); border-color: transparent; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 9px; }
.btn-icon svg { width: 16px; height: 16px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field label .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%; height: 42px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 0 12px; background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--g500); box-shadow: 0 0 0 4px rgba(46,149,99,.12); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--muted); }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--red); }
.field .err { color: var(--red); font-size: 12px; margin-top: 4px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--g700); }
.multi { border: 1px solid var(--border-strong); border-radius: 10px; max-height: 170px; overflow-y: auto; padding: 6px 10px; }
.multi .check { display: flex; padding: 4px 0; }
input[type=range] { accent-color: var(--g700); width: 100%; }

/* ---------- Filter bar ---------- */
.filters {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.filters-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.filters-head .t { font-weight: 700; color: var(--g900); display: flex; align-items: center; gap: 8px; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.filters-grid .field label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; color: var(--muted); }
.filters-grid .input, .filters-grid .select { height: 38px; font-size: 13px; }
.filters.collapsed .filters-grid { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--g100); color: var(--g800);
  border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 12px; font-weight: 600;
}
.chip button { border: 0; background: transparent; cursor: pointer; padding: 0; display: grid; place-items: center; color: var(--g700); }
.chip button svg { width: 14px; height: 14px; }

/* ---------- Badges & semáforo ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--grey-50); color: var(--text-2); border: 1px solid transparent;
}
.badge.green { background: var(--g100); color: var(--g800); }
.badge.gold { background: var(--gold-50); color: #8a6a1a; }
.badge.blue { background: var(--blue-50); color: var(--blue); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.amber { background: var(--amber-50); color: #9a6c00; }
.badge.outline { background: #fff; border-color: var(--border-strong); }
.sem { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sem::before { content: ""; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(0,0,0,.04); }
.sem.rojo::before { background: var(--red); box-shadow: 0 0 0 3px var(--red-50); }
.sem.amarillo::before { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-50); }
.sem.verde::before { background: var(--green); box-shadow: 0 0 0 3px var(--green-50); }
.sem.gris::before { background: var(--grey); box-shadow: 0 0 0 3px var(--grey-50); }
.sem.rojo { color: var(--red); } .sem.amarillo { color: #9a6c00; } .sem.verde { color: var(--green); } .sem.gris { color: var(--muted); }
.prio { font-size: 11.5px; font-weight: 700; }
.prio.Alta { color: var(--red); } .prio.Media { color: #9a6c00; } .prio.Baja { color: var(--muted); }

/* ---------- Table ---------- */
.tbl-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tbl-toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.tbl-toolbar .search input { height: 36px; padding-left: 36px; font-size: 13px; }
.tbl-toolbar .search svg { position: absolute; left: 11px; top: 9px; color: var(--muted); width: 16px; height: 16px; }
.tbl-toolbar .info { color: var(--muted); font-size: 12.5px; }
.tbl-toolbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; background: var(--surface-2);
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0; user-select: none;
}
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--g700); }
.tbl th .arr { opacity: .35; margin-left: 4px; font-size: 10px; }
.tbl th.sorted .arr { opacity: 1; color: var(--g700); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr:hover { background: var(--g50); }
.tbl tbody tr.selected { background: var(--gold-50); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td .t { font-weight: 600; color: var(--text); }
.tbl td .badge { white-space: normal; max-width: 170px; }
.tbl td .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 320px; }
.tbl .actions { display: flex; gap: 4px; justify-content: flex-end; }
.tbl-empty { padding: 44px 16px; text-align: center; color: var(--muted); }
.tbl-empty svg { width: 34px; height: 34px; color: var(--g300); margin-bottom: 8px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; }
.pager button { min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 600; font-size: 12.5px; }
.pager button.on { background: var(--g700); color: #fff; border-color: var(--g700); }
.pager button:disabled { opacity: .4; cursor: default; }
.pager select { height: 32px; border-radius: 8px; border: 1px solid var(--border); padding: 0 8px; }

/* ---------- Charts ---------- */
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 360px; }
.chart-box.short { height: 220px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list li.clickable { cursor: pointer; }
.list li.clickable:hover { background: var(--g50); }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 36px; gap: 10px; align-items: center; padding: 7px 0; }
.bar-row .n { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 10px; background: var(--g50); border-radius: 999px; overflow: hidden; display: flex; gap: 2px; }
.bar-track > i { display: block; height: 100%; }
.bar-track > i:last-child { border-radius: 0 999px 999px 0; }
.bar-row .v { text-align: right; font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.progress { height: 8px; background: var(--grey-50); border-radius: 999px; overflow: hidden; min-width: 80px; }
.progress > i { display: block; height: 100%; background: var(--g600); border-radius: 999px; }

/* ---------- Alert panel ---------- */
.alert-tile {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.alert-tile:hover { border-color: var(--g300); box-shadow: var(--shadow-sm); }
.alert-tile.on { border-color: var(--g600); box-shadow: 0 0 0 3px rgba(46,149,99,.14); }
.alert-tile .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.alert-tile .v { font-size: 22px; font-weight: 800; line-height: 1; }
.alert-tile .l { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.ic-red { background: var(--red-50); color: var(--red); }
.ic-amber { background: var(--amber-50); color: var(--amber); }
.ic-grey { background: var(--grey-50); color: var(--text-2); }
.ic-blue { background: var(--blue-50); color: var(--blue); }
.ic-green { background: var(--g100); color: var(--g700); }
.ic-gold { background: var(--gold-50); color: var(--gold); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button {
  border: 0; background: transparent; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center;
}
.tabs button:hover { color: var(--g700); }
.tabs button.on { color: var(--g800); border-bottom-color: var(--g700); }
.tabs .n { font-size: 11px; background: var(--grey-50); border-radius: 999px; padding: 0 7px; }

/* ---------- Detail ---------- */
.dl { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0; }
.dl > div { padding: 12px 20px; border-bottom: 1px solid var(--border); }
.dl > div:nth-child(odd) { border-right: 1px solid var(--border); }
.dl dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.dl dd { margin: 3px 0 0; font-weight: 600; word-break: break-word; }
.dl .full { grid-column: 1 / -1; border-right: 0 !important; }
.timeline { list-style: none; margin: 0; padding: 4px 20px 10px; }
.timeline li { position: relative; padding: 10px 0 10px 28px; border-left: 2px solid var(--g100); margin-left: 8px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 14px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--g500);
}
.timeline li.asig::before { border-color: var(--gold); }
.timeline li.alta::before { border-color: var(--blue); }
.timeline .d { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.timeline .t { font-weight: 600; }
.timeline .s { font-size: 12.5px; color: var(--text-2); }

.profile-head { display: flex; gap: 18px; align-items: center; padding: 22px; }
.profile-head h2 { font-size: 22px; color: var(--g900); }
.contact { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; color: var(--text-2); font-size: 13px; }
.contact span { display: inline-flex; gap: 6px; align-items: center; }
.contact svg { width: 15px; height: 15px; color: var(--g600); }

.person-card { padding: 18px; cursor: pointer; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 12px; }
.person-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.person-card .top { display: flex; gap: 12px; align-items: center; }
.person-card .name { font-weight: 700; color: var(--g900); }
.person-card .role { font-size: 12px; color: var(--muted); }
.person-card .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.person-card .stats div { background: var(--surface-2); border-radius: 10px; padding: 8px; text-align: center; }
.person-card .stats b { display: block; font-size: 17px; color: var(--g900); }
.person-card .stats span { font-size: 11px; color: var(--muted); }
.person-card.inactive { opacity: .6; }

/* ---------- Big search ---------- */
.bigsearch { display: flex; gap: 10px; max-width: 760px; }
.bigsearch .input { height: 54px; font-size: 17px; border-radius: 14px; padding-left: 50px; }
.bigsearch .wrap { position: relative; flex: 1; }
.bigsearch .wrap svg { position: absolute; left: 17px; top: 17px; color: var(--muted); width: 20px; height: 20px; }

/* ---------- Stepper ---------- */
.stepper { display: flex; gap: 0; margin-bottom: 22px; overflow-x: auto; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #fff; border: 1px solid var(--border); min-width: 160px; }
.step:first-child { border-radius: 12px 0 0 12px; }
.step:last-child { border-radius: 0 12px 12px 0; }
.step + .step { border-left: 0; }
.step .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--grey-50); color: var(--muted); font-size: 13px; flex-shrink: 0; }
.step .l { font-weight: 600; font-size: 13px; color: var(--muted); }
.step.on { background: var(--g50); }
.step.on .n { background: var(--g700); color: #fff; }
.step.on .l { color: var(--g900); }
.step.done .n { background: var(--g100); color: var(--g700); }
.step.done .l { color: var(--text-2); }
.dropzone {
  border: 2px dashed var(--g300); border-radius: 16px; background: var(--g50);
  padding: 46px 20px; text-align: center; cursor: pointer; transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.over { background: var(--g100); border-color: var(--g600); }
.dropzone svg { width: 42px; height: 42px; color: var(--g600); }
.dropzone h3 { margin-top: 10px; color: var(--g900); }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(6, 30, 18, .5); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; z-index: 100;
  padding: 5vh 16px; overflow-y: auto; animation: fade .15s ease;
}
.modal {
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 760px; animation: rise .2s ease;
}
.modal.sm { max-width: 460px; }
.modal.lg { max-width: 1080px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); gap: 12px; }
.modal-head h2 { font-size: 18px; color: var(--g900); }
.modal-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.modal-body { padding: 20px 22px; }
.modal-body.flush { padding: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.confirm-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Toast ---------- */
#toast-root { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  display: flex; gap: 12px; align-items: flex-start; min-width: 300px; max-width: 420px;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); padding: 14px 16px;
  border-left: 4px solid var(--green); animation: rise .2s ease;
}
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
.toast.info { border-left-color: var(--blue); }
.toast .t { font-weight: 700; }
.toast .s { font-size: 12.5px; color: var(--text-2); }
.toast.success svg { color: var(--green); } .toast.error svg { color: var(--red); } .toast.warn svg { color: var(--amber); } .toast.info svg { color: var(--blue); }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
.login-art {
  background: radial-gradient(900px 400px at 100% 0%, rgba(216,180,90,.25), transparent 60%),
              linear-gradient(150deg, var(--g900), var(--g700));
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login-art::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 60px solid rgba(255,255,255,.04); right: -180px; bottom: -200px; }
.login-art h1 { font-size: 38px; font-weight: 800; max-width: 520px; line-height: 1.15; }
.login-art p { color: #cfe6d8; font-size: 16px; max-width: 480px; }
.login-art .feats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 520px; position: relative; z-index: 1; }
.login-art .feats div { display: flex; gap: 10px; align-items: center; color: #dcefe4; font-size: 13.5px; }
.login-art .feats svg { color: var(--gold-l); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.login-form .box { width: 100%; max-width: 400px; }
.login-form h2 { font-size: 24px; color: var(--g900); }
.gold-line { width: 56px; height: 4px; border-radius: 4px; background: var(--gold); margin: 14px 0 18px; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state svg { width: 44px; height: 44px; color: var(--g300); }
.empty-state h3 { color: var(--g900); margin: 10px 0 4px; }
.note { background: var(--gold-50); border: 1px solid #efe0b5; color: #6f5515; border-radius: 12px; padding: 12px 14px; font-size: 13px; display: flex; gap: 10px; }
.note.info { background: var(--blue-50); border-color: #cddff5; color: #24508a; }
.note.ok { background: var(--g50); border-color: var(--g200); color: var(--g800); }
.note.bad { background: var(--red-50); border-color: #f2c9c9; color: #8f2626; }
.overlay { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 32px 24px; }
  .login-art h1 { font-size: 28px; }
}
@media (max-width: 720px) {
  .content { padding: 18px 16px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar .user-chip .meta, .search-global kbd { display: none; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .dl > div:nth-child(odd) { border-right: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding: 22px 20px; }
  .hero h1 { font-size: 22px; }
  .bar-row { grid-template-columns: 110px 1fr 30px; }
  .login-art .feats { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 20px; }
}

@media print {
  .sidebar, .topbar, .page-actions, .filters { display: none !important; }
  .main { margin: 0; }
}

/* ---------- Base compartida (claude.ai) ---------- */
:root { color-scheme: light; }
.splash { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 16px; text-align: center; background: var(--bg); }
.splash .brand-mark { width: 56px; height: 56px; font-size: 18px; }
.splash-t { font-weight: 800; font-size: 18px; color: var(--g900); }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--g50); color: var(--g700); white-space: nowrap; }
.sync svg.lucide { width: 15px; height: 15px; }
.sync.busy { background: var(--gold-50); color: #8a6a1a; }
.sync.busy svg.lucide { animation: spin 1.2s linear infinite; }
.sync.err { background: var(--red-50); color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sync.busy svg.lucide { animation: none; } }
@media (max-width: 720px) { .sync span { display: none; } }
.topbar { top: env(safe-area-inset-top, 0px); }
.sidebar { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }

@media (max-width: 560px) { .share-grid { grid-template-columns: 1fr !important; } .share-grid > div:first-child { max-width: 220px; } }

/* ==========================================================================
   Refinamiento visual institucional (Alcaldía de Bucaramanga – Secretaría de Planeación)
   Solo presentación: no cambia estructura ni comportamiento.
   ========================================================================== */
:root { --shadow-sm: 0 1px 2px rgba(11,61,38,.05), 0 2px 8px rgba(11,61,38,.04); --radius: 16px; }
body { background: #f2f5f3; }
.sidebar {
  background:
    radial-gradient(420px 260px at 0% 0%, rgba(216,180,90,.14), transparent 70%),
    radial-gradient(500px 400px at 100% 100%, rgba(46,149,99,.18), transparent 70%),
    linear-gradient(180deg, #0b3d26 0%, #072a1b 100%);
  box-shadow: 1px 0 0 rgba(255,255,255,.04), 8px 0 30px rgba(6,38,22,.12);
}
.brand { border-bottom-color: rgba(216,180,90,.18); }
.nav a { transition: background .15s, color .15s; }
.nav a.active { background: linear-gradient(90deg, rgba(216,180,90,.16), rgba(255,255,255,.06)); }
.topbar { box-shadow: 0 1px 0 var(--border), 0 6px 20px rgba(11,61,38,.04); }
.page-head h1 { letter-spacing: -.02em; }
.crumb { color: var(--g700); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.card { border-color: #e3eae6; }
.card-head h3 svg { color: var(--gold); }
.kpi { border-color: #e3eae6; }
.kpi .v { letter-spacing: -.02em; }
.hero { box-shadow: 0 18px 50px rgba(11,61,38,.18); }
.hero .eyebrow::before { content: ""; display: inline-block; width: 22px; height: 2px; background: var(--gold-l); vertical-align: middle; margin-right: 10px; border-radius: 2px; }
.tbl th { background: #f4f8f6; color: var(--g800); border-bottom: 2px solid var(--g100); }
.tbl tbody tr:nth-child(even) { background: #fbfcfb; }
.tbl tbody tr:hover { background: var(--g50); }
.btn-primary { box-shadow: 0 2px 8px rgba(20,108,67,.22); }
.filters { border-color: #e3eae6; }
.modal-head { background: linear-gradient(180deg, #f7faf8, #fff); border-radius: 18px 18px 0 0; }
.login-art { background:
    radial-gradient(700px 360px at 100% 0%, rgba(216,180,90,.25), transparent 60%),
    radial-gradient(600px 400px at 0% 100%, rgba(46,149,99,.35), transparent 65%),
    linear-gradient(150deg, #0b3d26, #146c43); }
