:root {
  --navy: #314151; --navy-d: #26323F; --ink: #1F2A36; --text: #3D4A59; --muted: #5A6573;
  --orange: #F8890A; --orange-d: #A35400; --cream: #FFF7EE; --line: #ECE4D9; --gray: #F4F6F8; --line2: #E3E7EC;
  --ok-bg: #E6F4EA; --ok: #1E6B34; --warn-bg: #FFF0DC; --warn: #8A4700; --bad-bg: #FDE8E8; --bad: #A12828;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Roboto, Arial, sans-serif; color: var(--ink); background: var(--gray); }
a { color: var(--orange-d); }
h1, h2, h3 { font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif; color: var(--navy); margin: 0; }
h1 { font-size: 34px; text-transform: uppercase; font-weight: 800; }
h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 19px; font-weight: 700; }
button, input, select, textarea { font: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--navy); background: var(--navy); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy-d); }
.btn.alt { background: #fff; color: var(--navy); }
.btn.alt:hover { background: var(--cream); }
.btn.orange { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.link { background: none; border: 0; color: var(--orange-d); padding: 0 4px; min-height: 36px; text-decoration: underline; }
.btn.danger { background: #fff; color: var(--bad); border-color: #E7B4B4; }
.btn:disabled { opacity: .55; cursor: wait; }

/* formularios */
label { display: block; font-size: 14px; font-weight: 500; color: var(--navy); margin-bottom: 6px; }
input, select, textarea { width: 100%; min-height: 44px; border: 1.5px solid #D5DBE1; border-radius: 10px; padding: 8px 12px; background: #fff; color: var(--ink); }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 1px; border-color: var(--orange); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 14px; font-size: 14px; }

/* acceso */
.login-wrap { min-height: 100vh; display: flex; flex-wrap: wrap; }
.login-side { flex: 1 1 420px; background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.login-side::after { content: ''; position: absolute; right: -140px; bottom: -160px; width: 460px; height: 460px; border-radius: 50%; border: 64px solid rgba(248,137,10,.12); }
.login-side h1 { color: #fff; font-size: 48px; line-height: 1; }
.login-side h1 span { color: var(--orange); }
.login-side p { color: #DCE2E8; font-size: 17px; line-height: 1.6; max-width: 460px; }
.login-main { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.login-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }

/* estructura */
.top { background: #fff; box-shadow: 0 1px 0 var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.top img { height: 40px; display: block; }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid transparent; background: none; cursor: pointer; font-weight: 500; color: var(--navy); }
.tab[aria-current="page"] { background: var(--navy); color: #fff; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 20px 80px; display: flex; flex-direction: column; gap: 22px; }
.card { background: #fff; border: 1px solid var(--line2); border-radius: 18px; padding: 22px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--muted); font-size: 14px; }
.hero { background: var(--navy); color: #fff; border-radius: 20px; padding: 24px 26px; display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.hero h1 { color: #fff; font-size: 30px; }
.hero .muted { color: #DCE2E8; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--line2); border-radius: 16px; padding: 16px 18px; }
.stat b { display: block; font-family: 'Roboto Condensed', sans-serif; font-size: 30px; color: var(--navy); }
.stat span { font-size: 14px; color: var(--muted); }
.bar { height: 10px; background: #EEF1F4; border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--orange); border-radius: 6px; }

/* etiquetas de estado */
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.s-Terminado, .s-Pagado { background: var(--ok-bg); color: var(--ok); }
.s-En-proceso { background: var(--orange); color: var(--ink); }
.s-Observado, .s-Vencida { background: var(--bad-bg); color: var(--bad); }
.s-Pendiente { background: #EEF1F4; color: var(--text); }
.s-En-revisión { background: var(--warn-bg); color: var(--warn); }
.s-Anulado { background: #EEF1F4; color: var(--muted); text-decoration: line-through; }

/* listas */
.list { display: flex; flex-direction: column; }
.item { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 4px; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .main { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item .main strong { font-size: 16px; }
.obs { background: var(--cream); border-left: 4px solid var(--orange); border-radius: 6px; padding: 8px 12px; font-size: 14px; color: var(--text); white-space: pre-line; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-family: 'Roboto Condensed', sans-serif; text-transform: uppercase; letter-spacing: .6px; font-size: 13px; color: var(--muted); padding: 10px 8px; border-bottom: 2px solid var(--line2); }
td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--cream); }
.scroll { overflow-x: auto; }
.drop { border: 2px dashed #C9D0D8; border-radius: 14px; padding: 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #FAFBFC; }

/* diálogo */
.modal-bg { position: fixed; inset: 0; background: rgba(15,20,26,.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal { background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 620px; max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.secret { font-family: 'Roboto Mono', Consolas, monospace; font-size: 22px; letter-spacing: 1px; background: var(--cream); border: 1.5px dashed var(--orange); border-radius: 12px; padding: 12px 16px; text-align: center; user-select: all; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; max-width: 90vw; }
#toast.show { opacity: 1; }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); }
@media (max-width: 700px) { .login-side { padding: 32px 24px; } .login-side::after { display: none; } .login-side h1 { font-size: 36px; } h1 { font-size: 28px; } .hide-sm { display: none; } }

/* ciclos */
.cycles { display: flex; gap: 12px; flex-wrap: wrap; }
.cycle { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 190px; padding: 14px 18px; border-radius: 16px; border: 1.5px solid var(--line2); background: #fff; cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.cycle:hover { border-color: var(--orange); }
.cycle.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.cycle .c-name { font-family: 'Roboto Condensed', sans-serif; font-weight: 800; font-size: 24px; }
.cycle .c-sub { font-size: 13px; opacity: .85; }
.cycle .c-grade { font-size: 13px; margin-top: 4px; }
.cycle.on .c-grade b { color: var(--orange); }
.s-En-curso { background: var(--warn-bg); color: var(--warn); }
.s-Aprobado { background: var(--ok-bg); color: var(--ok); }
.s-Desaprobado { background: var(--bad-bg); color: var(--bad); }
.s-Retirado { background: #EEF1F4; color: var(--muted); }
.cycle.on .pill { background: rgba(255,255,255,.15); color: #fff; }
.must { border: 1.5px solid var(--orange); background: #FFF8F0; border-radius: 14px; padding: 14px 16px; }
.must label { font-weight: 700; }
.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.svc { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 12px; background: #fff; }
.svc-h { margin: 14px 0 4px; font-size: 17px; color: var(--navy); }
.modal.wide { max-width: 900px; }
.vview { display: flex; flex-direction: column; gap: 12px; }
.vview img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 10px; background: #F3F4F6; }
.vview iframe { width: 100%; height: 70vh; border: 0; border-radius: 10px; background: #F3F4F6; }
.bell { position: relative; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 800; }
.badge[hidden] { display: none; }
.pendbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 16px; border-radius: 14px; background: #FFF4E5; border: 1.5px solid var(--orange); }
.rv-group { border: 1px solid var(--line2); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.rv-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line2); }
.notice { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; gap: 14px; align-items: center; max-width: 420px; padding: 14px 16px; border-radius: 14px; background: #fff; border: 2px solid var(--orange); box-shadow: 0 12px 30px rgba(15,20,26,.18); }
.tiny { font-size: 11.5px; color: var(--muted); }
.small { font-size: 13px; }
.svc.pend { border-color: var(--orange); background: #FFF8F0; }
.svc.rej { opacity: .7; }
.s-Pendiente-de-aprobación { background: #FFF1DD; color: #B45309; }
.s-No-aprobado { background: var(--bad-bg); color: var(--bad); }
.s-Rechazado { background: var(--bad-bg); color: var(--bad); }
tr.click { cursor: pointer; }
tr.click:hover td { background: #FFF8F0; }

/* filtros de la lista */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.flt { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.flt select { min-height: 38px; padding: 6px 10px; min-width: 150px; }
.flt.chk { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 500; min-height: 38px; }
.flt.chk input { width: auto; min-height: auto; }
.s-Nuevo { background: #E8F0FB; color: #1F4E86; }

/* estadísticas */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 820px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .kpis { grid-template-columns: 1fr; } }
.kpi { background: #fff; border: 1px solid var(--line2); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi b { font-family: 'Roboto Condensed', sans-serif; font-size: 28px; color: var(--ink); line-height: 1.1; }
.kpi small { font-size: 12.5px; color: var(--muted); }
.seg { display: inline-flex; background: var(--gray); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbar { display: flex; gap: 2px; height: 14px; align-items: stretch; }
.hbar i { display: block; height: 14px; }
.hbar i:first-child { border-radius: 0; }
.hbar i:last-child { border-radius: 0 4px 4px 0; }
.sttable td { vertical-align: middle; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.cols { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding-top: 22px; border-bottom: 1px solid var(--line2); }
.col { flex: 1; max-width: 64px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.col i { display: block; width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; }
.col .cv { font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.col .cl { position: absolute; bottom: -22px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.cols + * { margin-top: 18px; }
.tip { position: fixed; z-index: 80; display: none; background: var(--ink); color: #fff; font-size: 13px; padding: 8px 10px; border-radius: 8px; pointer-events: none; max-width: 320px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
