:root{--bg:#f4f5f7;--card:#fff;--ink:#16181d;--muted:#6b7280;--line:#e5e7eb;--accent:#1f6feb;--ok:#15803d;--warn:#b45309;--bad:#b91c1c;--soft:#eef2ff}
*{box-sizing:border-box}
body{margin:0;font:14px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--ink)}
[hidden]{display:none!important}
button{font:inherit;cursor:pointer;border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:8px;padding:7px 12px}
button:hover{border-color:#cbd5e1}
button.primary,.login-card button{background:var(--accent);border-color:var(--accent);color:#fff}
button.link{border:0;background:none;color:var(--muted);padding:0;text-decoration:underline}
input,select{font:inherit;border:1px solid var(--line);border-radius:8px;padding:7px 10px;background:#fff;color:var(--ink)}
.muted{color:var(--muted)}.err{color:var(--bad);min-height:1em;margin:0}
.brand{display:flex;align-items:center;gap:8px;font-weight:700;font-size:16px}
.brand-mark{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:8px;background:var(--accent);color:#fff;font-size:14px}
.login{min-height:100vh;display:grid;place-items:center;padding:20px}
.login-card{width:min(360px,100%);background:var(--card);border:1px solid var(--line);border-radius:14px;padding:28px;display:flex;flex-direction:column;gap:12px}
.login-card h1{margin:6px 0 0;font-size:20px}
.login-card label{display:flex;flex-direction:column;gap:4px;font-weight:500}
.shell{display:flex;flex-direction:column;min-height:100vh}
.topbar{background:#0f172a;color:#e2e8f0;padding:10px 24px;display:flex;align-items:center;gap:28px;position:sticky;top:0;z-index:5}
.topbar .brand{color:#fff}
.topbar nav{display:flex;gap:4px;flex:1;min-width:0}
.topbar nav a{display:flex;align-items:center;gap:8px;padding:9px 14px;border-radius:8px;color:#cbd5e1;cursor:pointer;text-decoration:none;font-size:14px;white-space:nowrap}
.topbar nav a svg{width:18px;height:18px;flex:none;fill:currentColor;opacity:.85}
.topbar nav a:hover{background:#1e293b}.topbar nav a.on{background:#1e293b;color:#fff;font-weight:600}.topbar nav a.on svg{opacity:1}
.side-foot{display:flex;align-items:center;gap:14px;font-size:13px;color:#94a3b8;flex:none}
.side-foot .link{color:#94a3b8}
main{padding:24px 28px;min-width:0;max-width:1400px;width:100%;margin:0 auto}
.head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.head h1{margin:0;font-size:22px}
.tools{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.kpis{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;margin-bottom:16px}
.kpi{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px 16px}
.kpi b{display:block;font-size:24px;margin:4px 0 2px;font-variant-numeric:tabular-nums}
.kpi span{color:var(--muted);font-size:13px}
.kpi.click{cursor:pointer}.kpi.click:hover{border-color:var(--accent)}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:16px;margin-bottom:16px;min-width:0}
.card h2{font-size:15px;margin:0 0 12px}
.bars{display:flex;align-items:flex-end;gap:3px;height:150px}
.bar{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;min-width:0;height:100%}
.bar i{display:block;width:100%;max-width:28px;background:var(--accent);border-radius:3px 3px 0 0}
.bar small{font-size:10px;color:var(--muted);margin-top:4px;white-space:nowrap}
.bar em{font-style:normal;font-size:10px;color:var(--muted)}
table{width:100%;border-collapse:collapse;font-size:13px}
th{text-align:left;color:var(--muted);font-weight:600;border-bottom:1px solid var(--line);padding:8px;white-space:nowrap;position:sticky;top:0;background:var(--card)}
td{border-bottom:1px solid #f1f5f9;padding:8px;vertical-align:top}
td.n,th.n{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
tr.row{cursor:pointer}tr.row:hover td{background:#f8fafc}
.scroll{overflow:auto;max-height:70vh}
.pill{display:inline-block;padding:2px 8px;border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap}
.pill.ativo{background:#dcfce7;color:var(--ok)}.pill.vencendo{background:#fef3c7;color:var(--warn)}.pill.vencido{background:#fee2e2;color:var(--bad)}.pill.sem{background:#f1f5f9;color:var(--muted)}
.pager{display:flex;gap:8px;align-items:center;justify-content:flex-end;margin-top:10px}
.drawer{position:fixed;inset:0;background:rgba(15,23,42,.45);display:flex;justify-content:center;align-items:flex-start;z-index:10;padding:28px 16px;overflow:auto}
.drawer-panel{width:min(1100px,100%);min-height:calc(100% - 0px);overflow:visible;background:var(--bg);padding:24px 28px 40px;position:relative;border-radius:14px;box-shadow:0 20px 50px rgba(0,0,0,.35)}
.drawer-x{position:absolute;right:16px;top:14px;font-size:20px;line-height:1;padding:4px 10px}
.dl{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px 16px}
.dl div span{display:block;color:var(--muted);font-size:12px}
.sections{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px;margin-bottom:0}
.section-card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px 16px}
.section-card h3{margin:0 0 10px;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.plan-group{margin:18px 0 6px;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:700}
.tabs{display:flex;gap:6px;flex-wrap:wrap;margin:14px 0}
.tabs button.on{background:var(--ink);color:#fff;border-color:var(--ink)}
.empty{color:var(--muted);padding:12px 0}
.note{background:var(--soft);border-radius:10px;padding:10px 12px;font-size:13px;color:#334155;margin-bottom:16px}
.ok{color:var(--ok);min-height:1em;margin:0}
.form-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px 14px;margin:12px 0}
.form-grid label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted);font-weight:500}
.form-grid label>input,.form-grid label>select{font-size:14px;color:var(--ink)}
.receber-box{background:var(--soft);border:1px solid #dbeafe;border-radius:12px;padding:14px 16px;margin:14px 0}
.receber-box h3{margin:0 0 4px;font-size:14px}
@media (max-width:820px){.topbar{flex-wrap:wrap;gap:10px;position:static}.topbar nav{order:3;width:100%}.grid2{grid-template-columns:1fr}main{padding:16px}.drawer{padding:0}.drawer-panel{border-radius:0;min-height:100%}}

:root {
  --bg: #f4f5f4; --ink: #202521; --muted: #535d56; --line: #dce1dd;
  --accent: #17684e; --soft: #edf5f0;
  --surface-shadow: 0 1px 2px #18261b0b, 0 3px 10px #18261b06;
}
body { font-size: 1rem; }
button, input, select { min-height: 40px; font-size: .875rem; }
button { font-weight: 600; }
button:disabled { opacity: .48; cursor: default; }
button.primary:not(:disabled):hover, .login-card button:hover { background: #11553f; }
:focus-visible { outline: 2px solid #208466; outline-offset: 3px; }
.topbar {
  background: #17221d; color: #fff; min-height: 64px;
  padding: 10px max(24px, calc((100% - 1296px) / 2));
  gap: 30px; box-shadow: 0 2px 10px #17221d22;
}
.topbar .brand { font-size: 1.0625rem; letter-spacing: -.02em; }
.brand-mark { background: #b8edcf; color: #173c2a; width: 32px; height: 32px; }
.topbar nav a { color: #d8e4dd; font-weight: 600; }
.topbar nav a:hover, .topbar nav a.on { background: #34483d; color: #fff; }
.side-foot, .side-foot .link { color: #d8e4dd; }
.side-foot .link { padding: 6px 8px; text-decoration: none; }
.side-foot .link:hover { background: #34483d; }
main { max-width: 1360px; padding: 32px; }
.head { align-items: center; margin-bottom: 20px; }
.head h1, .ficha-title { font-size: clamp(1.5rem, 2.6vw, 1.875rem); letter-spacing: -.035em; line-height: 1.2; }
.head p { margin: 5px 0 0; font-size: .875rem; }
.card, .section-card, .kpi { border-radius: 12px; box-shadow: var(--surface-shadow); }
.list-card { padding: 0; }
.list-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.list-toolbar .tools { flex: 1 1 350px; }
.list-toolbar input { flex: 1 1 220px; max-width: 380px; }
.list-count { color: var(--muted); font-size: .875rem; margin: 0; }
.scroll { border-radius: 0 0 12px 12px; }
table { font-size: .875rem; }
th { background: #f7f9f7; color: #47534b; }
th, td { padding: 11px 14px; vertical-align: middle; }
td { border-bottom-color: #eef0ee; }
tr:last-child td { border-bottom: 0; }
tr.row:hover td, tr.row:focus-within td { background: #f0f7f2; }
.list-card th:first-child, .list-card td:first-child { padding-left: 18px; }
.list-card th:last-child, .list-card td:last-child { padding-right: 18px; }
.list-card .empty { padding: 24px 18px; }
.cell-action {
  min-height: 0; padding: 2px 0; border: 0; background: transparent; text-align: left;
  color: #214d3a; font-weight: 650; overflow-wrap: anywhere;
}
.cell-action:hover { text-decoration: underline; }
.nowrap { white-space: nowrap; }
.pager { margin: 0; border-top: 1px solid var(--line); padding: 10px 18px; color: var(--muted); font-size: .875rem; }
.plan-group { background: #edf4ef; color: #385545; font-size: .8125rem; }
.tabs { gap: 4px; padding: 4px; border-radius: 10px; background: #e8ece9; width: fit-content; max-width: 100%; }
.tabs button { border-color: transparent; background: transparent; min-height: 38px; }
.tabs button.on { background: #fff; color: #174b36; border-color: #d5dfd7; box-shadow: var(--surface-shadow); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); }
.kpi b { font-size: clamp(1.2rem, 2vw, 1.65rem); overflow-wrap: anywhere; }
.bars { overflow-x: auto; gap: 5px; }
.bar { min-width: 39px; }
.drawer { background: #17221d80; }
.drawer-panel { width: min(1080px, 100%); min-height: 0; padding: 28px; }
.drawer-x { width: 40px; height: 40px; top: 14px; right: 14px; }
.ficha-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin: 0 44px 18px 0; }
.ficha-title { margin: 0 0 6px; overflow-wrap: anywhere; }
.ficha-head p { margin: 0; font-size: .875rem; }
.sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-card h3 { color: var(--ink); font-size: .9375rem; text-transform: none; letter-spacing: 0; }
.dl { grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: 10px 16px; font-size: .875rem; overflow-wrap: anywhere; }
.dl div span { font-size: .8125rem; }
.form-grid label { font-size: .875rem; }
.form-grid input, .form-grid select { width: 100%; min-width: 0; }
.login { background: radial-gradient(ellipse at top, #dcece2, #f4f5f4 68%); }
.login-card { width: min(420px, 100%); padding: clamp(22px, 5vw, 36px); box-shadow: 0 12px 48px #14291b16; }
.login-card h1 { font-size: 1.65rem; }
@media (max-width: 820px) {
  .topbar { gap: 8px 14px; justify-content: space-between; padding: 10px 16px; }
  .topbar nav { flex: 1 1 100%; overflow-x: auto; }
  .topbar nav a { padding: 8px 10px; gap: 6px; }
  main { padding: 22px 16px; }
  .drawer { padding: 10px; }
  .drawer-panel { border-radius: 12px; padding: 18px 14px; }
}
@media (max-width: 540px) {
  .sections { grid-template-columns: minmax(0, 1fr); }
  .list-toolbar, .pager { padding-inline: 12px; }
  .list-toolbar input { max-width: none; min-width: 0; }
  .list-toolbar select { flex: 1; }
  .ficha-head { margin-right: 38px; }
  .ficha-head button { text-align: left; }
  .side-foot #me { max-width: 105px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.ops-title { margin: 0 44px 18px 0; font-size: clamp(1.4rem, 2.5vw, 1.8rem); }
.student-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.student-avatar {
  width: 64px; height: 64px; flex: none; display: grid; place-items: center;
  border-radius: 14px; background: #deeee4; color: #214d3a;
  font-size: 1.4rem; font-weight: 700; overflow: hidden;
}
.student-avatar img { width: 100%; height: 100%; object-fit: cover; }
.student-actions { margin-bottom: 8px; }
.biometrics-panel { margin-top: 14px; }
.biometrics-head, .biometrics-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.biometrics-head h2 { margin: 0; }
.biometrics-panel > p { font-size: .875rem; }
.biometrics-controls a { color: var(--accent); font-size: .875rem; }
.biometrics-controls .ops-field { min-width: min(220px, 100%); }
.serial-output { background: var(--soft); padding: 12px; border-radius: 8px; min-height: 44px; white-space: pre-wrap; overflow-wrap: anywhere; }
#f-feedback { margin: 0 0 12px; }
#f-feedback:empty { display: none; }
.ops-days, .exercise-row { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.ops-days { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.ops-days label, .ops-check { display: inline-flex; gap: 6px; align-items: center; font-size: .875rem; }
.ops-days input, .ops-check input { min-height: 0; width: 18px; height: 18px; accent-color: var(--accent); }
.ops-field, .exercise-row label { display: grid; gap: 4px; font-size: .875rem; min-width: 0; }
.ops-field { margin: 12px 0; }
.ops-field textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; resize: vertical; }
.exercise-row { display: grid; grid-template-columns: minmax(140px, 2fr) repeat(4, minmax(72px, 1fr)) auto; align-items: end; gap: 8px; }
.exercise-row input { width: 100%; min-width: 0; }
@media (max-width: 670px) {
  .exercise-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exercise-row label:first-child { grid-column: 1 / -1; }
}
