/* Faith Academy LMS -- same look as FA Records. */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #e2e5e9;
  --ink: #1d2327;
  --muted: #5f6b76;
  --teal: #2c5f5d;
  --teal-dark: #214846;
  --teal-soft: #e6efee;
  --red: #b3261e;
  --red-soft: #fbe9e8;
  --amber: #9a6100;
  --amber-soft: #fff4dc;
  --green: #1f6b3a;
  --green-soft: #e5f3ea;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 700; margin: 0 0 .4em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
a { color: var(--teal); }
code, .mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .88em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---- header ---- */
.topbar { background: var(--teal); color: #fff; }
.topbar .inner {
  max-width: 1180px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 18px; min-height: 56px; flex-wrap: wrap;
}
.brand { font-family: Georgia, serif; font-weight: 700; font-size: 1.15rem; color: #fff;
         text-decoration: none; margin-right: 8px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: #dfeceb; text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.nav a:hover, .nav a.on { background: rgba(255,255,255,.14); color: #fff; }
.who { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: #dfeceb; }
.who form { margin: 0; }
.linkbtn { background: none; border: 0; color: #fff; text-decoration: underline;
           cursor: pointer; font: inherit; padding: 0; }

main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-start;
            gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.back { display: inline-block; margin-bottom: 8px; font-size: .92rem; }
footer { max-width: 1180px; margin: 0 auto; padding: 0 16px 24px; color: var(--muted);
         font-size: .8rem; }

/* ---- cards ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 18px 20px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.stats { display: flex; gap: 32px; flex-wrap: wrap; padding-bottom: 12px;
         border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.stat .label { font-size: .82rem; color: var(--muted); }
.stat .value { font-family: Georgia, serif; font-size: 1.25rem; font-weight: 700; }

/* ---- flash ---- */
.flash { border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; border: 1px solid; }
.flash.success { background: var(--green-soft); border-color: #bfdcc9; color: var(--green); }
.flash.error   { background: var(--red-soft); border-color: #f0c6c3; color: var(--red); }
.flash.info    { background: var(--teal-soft); border-color: #c9dcda; color: var(--teal-dark); }
.warnbox { background: var(--red-soft); border-radius: 8px; padding: 10px 14px; color: var(--red);
           margin-bottom: 14px; }
.notebox { background: var(--amber-soft); border-radius: 8px; padding: 10px 14px;
           color: var(--amber); margin-bottom: 14px; }
.staffbar { background: var(--amber-soft); color: var(--amber); border: 1px solid #f1dcb0;
            border-radius: 8px; padding: 8px 14px; margin-bottom: 14px; display: flex;
            gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---- buttons & forms ---- */
.btn { display: inline-block; background: var(--teal); color: #fff; border: 1px solid var(--teal);
       border-radius: 7px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer;
       text-decoration: none; line-height: 1.3; }
.btn:hover { background: var(--teal-dark); }
.btn.secondary { background: #fff; color: var(--ink); border-color: #cfd4da; }
.btn.secondary:hover { background: #f3f4f6; }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn.small { padding: 4px 10px; font-size: .85rem; font-weight: 500; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
label { display: block; font-size: .88rem; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cfd4da; border-radius: 7px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid #9cc4c1; border-color: var(--teal); }
.form-grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
             margin-bottom: 14px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: .95rem; }
.check input { width: auto; }
.inline { display: inline; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
         vertical-align: top; }
th { font-size: .82rem; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px;
        flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted);
          border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--teal); border-color: var(--teal); font-weight: 600; }

.pill { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 999px;
        background: #eef0f2; color: var(--muted); white-space: nowrap; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.teal { background: var(--teal-soft); color: var(--teal-dark); }

/* ---- student course cards ---- */
.course-card { display: flex; flex-direction: column; gap: 6px; }
.course-card h3 a { text-decoration: none; color: var(--ink); }
.course-card h3 a:hover { color: var(--teal); }
.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { display: flex; justify-content: space-between; align-items: center; gap: 10px;
              padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.doclist li:last-child { border-bottom: 0; }
.docname { display: flex; gap: 8px; align-items: center; }
.pdf-icon { display: inline-block; width: 22px; height: 26px; border-radius: 3px;
            background: var(--red); color: #fff; font-size: 8px; font-weight: 700;
            line-height: 26px; text-align: center; flex: none; }
.weekhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
            flex-wrap: wrap; }

/* ---- login ---- */
.login-wrap { max-width: 400px; margin: 7vh auto; }
.login-wrap .card { padding: 26px; }
.login-wrap h1 { text-align: center; }

/* ---- upload ---- */
.dropzone { border: 2px dashed #b9c6c5; border-radius: var(--radius); padding: 28px; text-align: center;
            background: #fafbfb; transition: background .15s, border-color .15s; }
.dropzone.over { background: var(--teal-soft); border-color: var(--teal); }
.upl-table select { min-width: 220px; }
.upl-table tr.unsure td { background: #fffaf0; }
.upl-table tr.skipped td { opacity: .5; }
.upl-table tr.done td { background: #f5fbf7; }
.upl-table tr.failed td { background: #fdf3f2; }
.progress { height: 8px; background: #e9ecef; border-radius: 99px; overflow: hidden; margin: 10px 0; }
.progress > div { height: 100%; background: var(--teal); width: 0; transition: width .2s; }
.sticky-actions { position: sticky; bottom: 0; background: var(--card); padding-top: 12px;
                  border-top: 1px solid var(--line); display: flex; gap: 12px;
                  align-items: center; flex-wrap: wrap; }

@media (max-width: 640px) {
  main { padding: 16px 12px 32px; }
  .card { padding: 14px; }
  .stats { gap: 18px; }
  .upl-table select { min-width: 160px; }
}

/* ---- upload box on a course page: stays in view while scrolling ---- */
.sticky-upload { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px 14px;
                 align-items: center; padding: 12px 16px; border-color: #bcd3d1;
                 background: #f7fbfb; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.sticky-upload select { width: auto; min-width: 190px; display: inline-block; margin-left: 6px; }
.sticky-upload input[type=file] { max-width: 320px; }
.inline-label { display: inline-flex; align-items: center; margin: 0; color: var(--ink); font-size: .95rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px;
       vertical-align: middle; background: #b8bec4; }
.dot.on { background: #2e9e5b; }
tr.inactive td { color: var(--muted); }
tr.inactive td a { color: var(--muted); }
.upl-table .title-input { min-width: 260px; font-size: .9rem; padding: 6px 8px; }
.pdf-icon.doc { background: #2b579a; }
.pdf-icon.xls { background: #217346; }
.pdf-icon.ppt { background: #c43e1c; }
.pdf-icon.txt, .pdf-icon.file { background: #5f6b76; }
/* staff menu has 9 items: keep it on one line on a normal screen */
.nav a { padding: 6px 8px; font-size: .93rem; white-space: nowrap; }
.topbar .inner { gap: 12px; }
.who { font-size: .86rem; }
.topbar .inner { max-width: 1320px; }
/* "not live" notice on Progress and Payments */
.asof { background: var(--amber-soft); border: 2px solid #e8c36d; border-radius: var(--radius);
        padding: 14px 18px; margin: 0 0 18px; color: #6b4600; }
.asof-when { font-family: Georgia, serif; font-size: 1.35rem; font-weight: 700; margin-bottom: 4px;
             color: #5a3b00; }
@media print { .asof { border-width: 1px; } .row-actions, .staffbar, .topbar { display: none !important; } }
/* ---- Monitoring → System ---- */
.sys-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.meter-row { display: grid; grid-template-columns: 70px 1fr 48px 130px; gap: 10px; align-items: center;
             margin-bottom: 10px; }
.meter-label { font-weight: 600; font-size: .92rem; }
.meter { height: 12px; background: #e9ecef; border-radius: 99px; overflow: hidden; }
.meter > div { height: 100%; background: var(--teal); border-radius: 99px; }
.meter > div.warm { background: #d49a1c; }
.meter > div.hot { background: var(--red); }
.meter-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
table.kv th { width: 45%; font-size: .9rem; color: var(--muted); font-weight: 500; }
table.kv td { font-size: .93rem; }
@media (max-width: 640px) {
  .sys-grid { grid-template-columns: 1fr; }
  .meter-row { grid-template-columns: 60px 1fr 44px; }
  .meter-sub { grid-column: 2 / -1; margin-top: -6px; }
}
table.kv tr:last-child th { border-bottom: 0; }
.login-logo { display: block; margin: -4px auto 10px; width: 150px; height: auto; }
/* ---- video links ---- */
.pdf-icon.vid { background: #6b3fa0; font-size: 11px; }
.add-link { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 12px 16px; }
.add-link select { width: auto; min-width: 110px; display: inline-block; margin-left: 6px; }
.link-edit { display: grid; gap: 6px; margin-top: 6px; min-width: 320px; }
.link-edit label { margin: 0; }
.link-edit select { width: auto; margin-left: 6px; }
.unsure-card { border-color: #e8c36d; }
/* ---- All term ---- */
.allterm { border-color: #bcd3d1; }
.atgroup { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; background: #fcfdfd; }
.atgroup > summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 0; }
.atgroup-tools { display: grid; gap: 8px; margin-top: 8px; }
.inline-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-tools input[type=file] { max-width: 320px; }
.pdf-icon.aud { background: #0f7b6c; font-size: 13px; }
audio { height: 32px; margin-top: 4px; max-width: 100%; width: 320px; }
.audiobar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 2px solid var(--teal);
            box-shadow: 0 -2px 10px rgba(0,0,0,.08); display: flex; gap: 12px; align-items: center; padding: 8px 16px; flex-wrap: wrap; }
.audiobar[hidden] { display: none; }
.audiobar-title { font-weight: 600; flex: 1 1 200px; }
.audiobar audio { flex: 2 1 320px; width: auto; margin: 0; }
