/* ClassLens. One stylesheet, no build step. print.css adds the paper rules. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #d9dde3;
  --line-soft: #e8ebef;
  --text: #1c2430;
  --muted: #5d6877;
  --faint: #8792a0;
  --brand: #1f5fbf;
  --brand-dark: #184c9a;
  --brand-tint: #eaf1fb;
  --ok: #17703f;
  --ok-tint: #e8f5ee;
  --warn: #8a4b08;
  --warn-line: #b4690e;
  --warn-tint: #fdf4e3;
  --bad: #b3261e;
  --bad-tint: #fdecea;
  --teal: #0f6b62;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "Noto Sans Bengali", "Nirmala UI",
          "Hind Siliguri", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 0.93em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---- top bar ----------------------------------------------------------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 6px 22px; flex-wrap: wrap; min-height: 54px;
}
.brand { font-weight: 800; font-size: 17px; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand span { color: var(--brand); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); padding: 6px 10px; border-radius: 6px; font-weight: 600; font-size: 14px;
}
.nav a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--brand-tint); color: var(--brand-dark); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.who strong { color: var(--text); font-weight: 600; }

.page { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
.page-narrow { max-width: 720px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 14px; }

/* ---- cards ------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 18px;
}
.card > h2 { margin-bottom: 14px; }
.card h3 { margin: 18px 0 8px; }
.card h3:first-of-type { margin-top: 0; }
.card-tight { padding: 12px 16px; }

/* ---- buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 14px; line-height: 1.2;
  padding: 9px 16px; border-radius: 7px; cursor: pointer;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; }
.btn-line { background: var(--surface); color: var(--text); border-color: #b9c0ca; }
.btn-line:hover { background: var(--bg); border-color: #98a1ae; }
.btn-brand-line { background: var(--surface); color: var(--brand); border-color: var(--brand); }
.btn-brand-line:hover { background: var(--brand-tint); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-tint); border-color: var(--bad); }
.btn-small { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn[disabled], .btn.is-disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ---- forms ------------------------------------------------------------- */
.field { margin-bottom: 14px; }
.field label, .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.field .hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url],
input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff;
  border: 1px solid #b9c0ca; border-radius: 7px; padding: 8px 10px;
}
textarea { min-height: 90px; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 13px; min-height: 420px; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid #9dbdea; outline-offset: 0; border-color: var(--brand);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 18px; }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-row label { font-weight: 500; display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; min-width: 150px; flex: 1 1 150px; }
.filters .field.fixed { flex: 0 0 auto; }

/* ---- alerts ------------------------------------------------------------ */
.alert {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; margin-bottom: 16px;
  background: var(--surface);
}
.alert-ok { background: var(--ok-tint); border-color: #b9dfc8; color: #114e2d; }
.alert-error { background: var(--bad-tint); border-color: #f1bdb8; color: #7d1a14; }
.alert-warn { background: var(--warn-tint); border-color: #ecd3a4; color: #6b3a06; }
.alert-info { background: var(--brand-tint); border-color: #c3d6f3; color: #153f7e; }
.alert strong { font-weight: 700; }

/* ---- tables ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.list td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #fafbfc; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }

table.kv { border-collapse: collapse; width: 100%; }
table.kv th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 18px 6px 0; width: 230px; vertical-align: top; }
table.kv td { padding: 6px 0; font-weight: 600; word-break: break-word; }

/* ---- pills ------------------------------------------------------------- */
.pill {
  display: inline-block; font-size: 12px; font-weight: 700; line-height: 1;
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: #fff;
  white-space: nowrap;
}
.pill-ok { color: var(--ok); border-color: #9dd0b3; background: var(--ok-tint); }
.pill-run { color: var(--brand-dark); border-color: #b3cbef; background: var(--brand-tint); }
.pill-bad { color: var(--bad); border-color: #eeb0aa; background: var(--bad-tint); }
.pill-warn { color: var(--warn); border-color: #e6c98f; background: var(--warn-tint); }
.pill-appropriate { color: var(--teal); border-color: var(--teal); }
.pill-rushed { color: var(--warn); border-color: var(--warn-line); }
.pill-wasted { color: var(--bad); border-color: var(--bad); }

/* ---- evaluation header ------------------------------------------------- */
.meta { display: flex; flex-wrap: wrap; gap: 4px 26px; margin: 10px 0 16px; font-size: 15px; }
.meta b { font-weight: 700; }
.meta span span { color: var(--muted); }
.summary-strip {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 18px; font-weight: 700;
}
.summary-strip.is-clear { color: var(--ok); }

/* ---- scorecard --------------------------------------------------------- */
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.score {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 16px 14px; position: relative;
}
.score-name { font-size: 15px; color: #3a4553; }
.score-value { font-size: 36px; font-weight: 800; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.score-value small { font-size: 15px; font-weight: 500; color: var(--muted); }
.score.is-low { border-color: #eeb0aa; background: #fffafa; }
.score.is-low .score-value { color: var(--bad); }
.score .pill { position: absolute; top: 12px; right: 12px; }
.score-was { font-size: 12px; color: var(--muted); margin-top: 4px; }
.score-why { font-size: 13px; color: var(--muted); margin-top: 8px; }
.scale-note { color: var(--muted); font-size: 14px; margin-top: 12px; }
details.plain { margin-top: 12px; }
details.plain > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--brand); }
details.plain[open] > summary { margin-bottom: 10px; }

/* ---- flags ------------------------------------------------------------- */
.none-found { color: var(--ok); font-weight: 700; }
.not-checked { color: var(--muted); }
.flag {
  border: 1px solid var(--warn-line); border-left-width: 5px; border-radius: 6px;
  padding: 11px 14px 12px; margin-bottom: 12px; background: #fff;
}
.flag-conduct { border-color: var(--bad); }
.flag.is-dismissed { border-color: var(--line); background: #fafbfc; }
.flag.is-dismissed .flag-body, .flag.is-dismissed .flag-fix { color: var(--faint); text-decoration: line-through; text-decoration-color: #c5cbd3; }
.flag-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 5px; }
.flag-tag { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.flag-time { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--text); }
.flag-fix { color: #4b5563; margin-top: 6px; }
.flag-fix b { color: var(--text); }
.flag-review { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.flag-review input[type=text] { flex: 1 1 220px; padding: 5px 8px; font-size: 13px; }
.review-state { font-size: 13px; color: var(--muted); }
ul.plain-list { margin: 0; padding-left: 20px; }
ul.plain-list li { margin-bottom: 7px; }
ul.plain-list li.is-dismissed { color: var(--faint); text-decoration: line-through; }
.li-actions { display: inline-flex; gap: 6px; margin-left: 6px; vertical-align: middle; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--brand); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---- time audit -------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 20px; margin-bottom: 16px; }
.stat-name { color: var(--muted); font-size: 14px; }
.stat-value { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; margin-bottom: 10px; }
.legend i { display: inline-block; width: 26px; height: 14px; border: 1px solid #aab2bd; vertical-align: -2px; margin-right: 6px; border-radius: 2px; }
.swatch-appropriate { background: #cfe8e4; }
.swatch-rushed { background: repeating-radial-gradient(circle at 3px 3px, #b4690e 0 1.2px, #fdf4e3 1.3px 6px); background-size: 6px 6px; }
.swatch-wasted { background: repeating-linear-gradient(45deg, #b3261e 0 2px, #fdecea 2px 6px); }
.timebar { display: flex; height: 30px; border: 1px solid #aab2bd; border-radius: 5px; overflow: hidden; background: #fff; }
.timebar span { display: block; height: 100%; border-right: 1px solid #fff; min-width: 2px; }
.timebar span:last-child { border-right: 0; }
.timebar-ends { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
.segments { list-style: none; margin: 0; padding: 0; }
.segments li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 4px 0; }
.segments .seg-time { font-family: var(--mono); font-weight: 700; font-size: 14px; }
.segments .seg-min { color: var(--muted); }
.segments .seg-note { flex-basis: 100%; color: var(--muted); font-size: 14px; padding-left: 4px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 34px; }

/* ---- status panel ------------------------------------------------------ */
.status-panel { display: flex; gap: 16px; align-items: center; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  border: 3px solid #cfd9ea; border-top-color: var(--brand); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- sign-in ----------------------------------------------------------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px 28px 24px; }
.auth-card .brand { font-size: 20px; display: block; margin-bottom: 4px; }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); margin-bottom: 18px; }
.auth-card .btn { width: 100%; justify-content: center; padding: 10px 16px; }
.auth-alt { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* ---- upload ------------------------------------------------------------ */
.progress { height: 10px; border-radius: 999px; background: #e3e7ed; overflow: hidden; margin: 8px 0 4px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.2s; }
.upload-box { border: 1px dashed #aab2bd; border-radius: var(--radius); padding: 14px 16px; background: #fbfcfd; }
.upload-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }

@media (max-width: 720px) {
  .grid-2, .grid-3, .two-col { grid-template-columns: 1fr; }
  .who { margin-left: 0; width: 100%; padding-bottom: 8px; }
  table.kv th { width: 130px; }
  h1 { font-size: 22px; }
}
