:root {
  --teal: #007482; --teal-dark: #005862; --teal-soft: #e3f1f3;
  --gold: #c9a516; --green: #019e7c; --green-soft: #dff5ee; --blue: #00a2e8;
  --amber: #b86e00; --amber-soft: #fff1d6; --grey-soft: #eef0f2;
  --ink: #1f2933; --muted: #6b7280; --line: #e3e7ea; --bg: #f3f6f7; --card: #ffffff;
  --radius: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 Roboto, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--teal); }
h1 { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 13px; }

/* Cabecera */
.top { background: #fff; border-bottom: 3px solid var(--teal); }
.top .in { max-width: 1200px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.top img.logo { height: 44px; width: auto; display: block; }
.top .title { font-weight: 500; color: var(--muted); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.top nav { margin-left: auto; display: flex; gap: 6px; }
.top nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 14px; }
.top nav a:hover, .top nav a.on { background: var(--teal-soft); color: var(--teal-dark); }

main { max-width: 1200px; margin: 28px auto 60px; padding: 0 20px; }
.crumb { font-size: 13px; margin-bottom: 10px; }
.crumb a { text-decoration: none; }
.head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.head .sub { margin-top: 4px; }

/* Botones y formularios */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; box-shadow: var(--shadow); white-space: nowrap; }
.btn:hover { border-color: #c9d1d6; background: #fafbfb; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-dark); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.gold:hover { filter: brightness(.95); }
.btn svg { width: 16px; height: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
form.inline { display: inline; }
.search { position: relative; flex: 1; min-width: 240px; max-width: 420px; }
.search input { width: 100%; padding: 10px 12px 10px 38px; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: #fff; }
.search input:focus { outline: 2px solid var(--teal-soft); border-color: var(--teal); }
.search svg { position: absolute; left: 12px; top: 11px; width: 18px; height: 18px; color: var(--muted); }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 18px; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 8px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--teal-soft); color: var(--teal-dark); font-weight: 600; }

/* Tarjetas */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.kpi { padding: 14px 16px; border-left: 4px solid var(--teal); }
.kpi b { display: block; font-size: 26px; font-weight: 700; line-height: 1.1; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi.ok { border-left-color: var(--green); } .kpi.mid { border-left-color: var(--gold); } .kpi.no { border-left-color: #9aa3ab; }

/* Tablas */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { position: sticky; top: 0; background: #f7f9fa; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover td { background: #fbfcfc; }
tr.student td { background: var(--teal-soft); font-weight: 600; color: var(--teal-dark); }
tr.student td small { font-weight: 400; color: var(--muted); margin-left: 8px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.avatar { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: var(--teal); color: #fff; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-right: 10px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--green-soft); color: #0a6b55; } .pill.mid { background: var(--amber-soft); color: var(--amber); } .pill.no { background: var(--grey-soft); color: #5b6670; }
.meter { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.meter .track { flex: 1; height: 8px; border-radius: 4px; background: #e6ebee; overflow: hidden; }
.meter .fill { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
.meter .fill.ok { background: var(--green); } .meter .fill.mid { background: var(--gold); }
.meter em { font-style: normal; font-size: 12px; color: var(--muted); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.count { font-size: 13px; color: var(--muted); }

/* Lista de empresas */
.co-name { font-weight: 600; text-decoration: none; color: var(--ink); }
.co-name:hover { color: var(--teal); }

/* Acceso */
.login { max-width: 400px; margin: 56px auto; padding: 32px; text-align: center; }
.login img { height: 64px; margin-bottom: 14px; }
.login label { display: block; text-align: left; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.login input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.login .err { background: #fdecec; color: #9b1c1c; padding: 8px 10px; border-radius: 8px; font-size: 13px; margin-top: 10px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 40px; }
.foot img { height: 16px; vertical-align: middle; opacity: .6; margin-left: 6px; }

@media (max-width: 720px) {
  h1 { font-size: 22px; }
  .top img.logo { height: 36px; } .top .title { display: none; }
  th.hide-m, td.hide-m { display: none; }
  main { margin-top: 18px; }
}
@media print {
  .top nav, .actions, .bar, .foot { display: none !important; }
  body { background: #fff; } .card { box-shadow: none; }
}
