/* ============================================================
   DrLPLAL Teacher Portal — Stylesheet
   Design tokens shared with /quiz1/assets/quiz1.css (student)
   ============================================================ */

:root {
  --c-blue:    #0E3A6B;
  --c-blue-d:  #082547;
  --c-cream:   #F6F4EE;
  --c-cream-2: #EFEAD8;
  --c-gold:    #B08B3E;
  --c-gold-d:  #8a6c2c;
  --c-text:    #1a1a1a;
  --c-muted:   #5b5b5b;
  --c-line:    #d8d2bf;
  --c-ok:      #2f6b3a;
  --c-warn:    #b06a00;
  --c-err:     #a02a2a;
  --c-row-alt: #faf8f1;

  --f-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --f-sans:  'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont,
             'Segoe UI', Roboto, sans-serif;

  --r:    8px;
  --r-lg: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-cream);
  color: var(--c-text);
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--c-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--f-serif);
  color: var(--c-blue-d);
  margin: 0 0 0.6em 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

/* ---------- Top bar ---------- */
.tp-top {
  background: var(--c-blue);
  color: var(--c-cream);
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--c-gold);
}
.tp-top .school {
  font-family: var(--f-serif);
  font-size: 1.15rem;
  line-height: 1.15;
}
.tp-top .school small {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.85;
  font-family: var(--f-sans);
}
.tp-top .who {
  font-size: 0.9rem;
  text-align: right;
}
.tp-top .who a {
  color: var(--c-cream);
  border-bottom: 1px dotted var(--c-cream);
}

/* ---------- Nav bar ---------- */
.tp-nav {
  background: var(--c-blue-d);
  border-bottom: 1px solid #000;
  padding: 0 12px;
  overflow-x: auto;
  white-space: nowrap;
}
.tp-nav a {
  display: inline-block;
  color: var(--c-cream);
  padding: 11px 16px;
  font-size: 0.92rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
}
.tp-nav a:hover {
  background: rgba(255,255,255,0.06);
  text-decoration: none;
}
.tp-nav a.active {
  border-bottom-color: var(--c-gold);
  background: rgba(176,139,62,0.12);
}

/* ---------- Page wrap ---------- */
.tp-wrap {
  max-width: 1320px;
  margin: 22px auto 60px auto;
  padding: 0 22px;
}
.tp-crumb {
  color: var(--c-muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.tp-crumb a { color: var(--c-muted); }

/* ---------- Cards ---------- */
.tp-card {
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.tp-card h2:first-child,
.tp-card h3:first-child { margin-top: 0; }

/* ---------- Stat tiles (dashboard) ---------- */
.tp-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.tp-tile {
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  border-left: 5px solid var(--c-blue);
  display: block;
  color: var(--c-text);
}
.tp-tile:hover { background: var(--c-row-alt); text-decoration: none; }
.tp-tile.warn { border-left-color: var(--c-warn); }
.tp-tile.err  { border-left-color: var(--c-err); }
.tp-tile.ok   { border-left-color: var(--c-ok); }
.tp-tile .num {
  font-family: var(--f-serif);
  font-size: 2rem;
  color: var(--c-blue-d);
  line-height: 1;
}
.tp-tile .lbl {
  font-size: 0.85rem;
  color: var(--c-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Tables ---------- */
.tp-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.92rem;
}
.tp-table th, .tp-table td {
  padding: 9px 11px;
  text-align: left;
  border-bottom: 1px solid var(--c-line);
  vertical-align: top;
}
.tp-table thead th {
  background: var(--c-cream-2);
  color: var(--c-blue-d);
  font-family: var(--f-serif);
  font-weight: 600;
  border-bottom: 2px solid var(--c-gold);
}
.tp-table tbody tr:nth-child(odd) { background: var(--c-row-alt); }
.tp-table tbody tr:hover { background: #f1eed8; }
.tp-table tr.row-warn { background: #fdf3e0 !important; }
.tp-table tr.row-err  { background: #fae3e3 !important; color: var(--c-err); }
.tp-table tr.row-ok   { background: #eaf5e8 !important; }

.tp-table .num   { text-align: right; font-variant-numeric: tabular-nums; }
.tp-table .nowrap{ white-space: nowrap; }

/* ---------- Forms ---------- */
.tp-form label {
  display: block;
  font-size: 0.9rem;
  color: var(--c-blue-d);
  font-weight: 600;
  margin-bottom: 4px;
  margin-top: 12px;
}
.tp-form input[type=text],
.tp-form input[type=number],
.tp-form input[type=password],
.tp-form input[type=date],
.tp-form input[type=file],
.tp-form select,
.tp-form textarea {
  width: 100%;
  max-width: 560px;
  padding: 9px 11px;
  font-size: 0.95rem;
  font-family: var(--f-sans);
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--r);
  color: var(--c-text);
}
.tp-form input:focus,
.tp-form select:focus,
.tp-form textarea:focus {
  outline: 2px solid var(--c-gold);
  outline-offset: 0;
  border-color: var(--c-gold);
}
.tp-form textarea { min-height: 110px; resize: vertical; }
.tp-form .hint {
  font-size: 0.8rem;
  color: var(--c-muted);
  margin-top: 3px;
}

.tp-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 22px;
}
@media (max-width: 720px) { .tp-grid-2 { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.tp-btn {
  display: inline-block;
  background: var(--c-blue);
  color: var(--c-cream);
  padding: 9px 18px;
  border-radius: var(--r);
  border: none;
  font-family: var(--f-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.tp-btn:hover { background: var(--c-blue-d); text-decoration: none; }
.tp-btn:disabled { background: #888; cursor: not-allowed; }
.tp-btn.gold     { background: var(--c-gold); }
.tp-btn.gold:hover { background: var(--c-gold-d); }
.tp-btn.ghost {
  background: transparent;
  color: var(--c-blue);
  border: 1px solid var(--c-blue);
}
.tp-btn.ghost:hover { background: var(--c-blue); color: var(--c-cream); }
.tp-btn.danger    { background: var(--c-err); }
.tp-btn.danger:hover { background: #7a1f1f; }
.tp-btn.sm  { padding: 5px 11px; font-size: 0.85rem; }

.tp-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Alerts ---------- */
.tp-alert {
  padding: 11px 14px;
  border-radius: var(--r);
  margin-bottom: 16px;
  border: 1px solid var(--c-line);
  background: #fff;
}
.tp-alert.ok   { background: #eaf5e8; border-color: #b9d8b3; color: var(--c-ok); }
.tp-alert.warn { background: #fdf3e0; border-color: #e8c992; color: var(--c-warn); }
.tp-alert.err  { background: #fae3e3; border-color: #d8a4a4; color: var(--c-err); }

/* ---------- Pills / badges ---------- */
.tp-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--c-line);
  background: #fff;
}
.tp-pill.ok   { background: #eaf5e8; color: var(--c-ok);   border-color: #b9d8b3; }
.tp-pill.warn { background: #fdf3e0; color: var(--c-warn); border-color: #e8c992; }
.tp-pill.err  { background: #fae3e3; color: var(--c-err);  border-color: #d8a4a4; }
.tp-pill.blue { background: #e3eaf3; color: var(--c-blue-d); border-color: #b6c4d9; }

/* ---------- Login screen ---------- */
.tp-login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--c-blue), var(--c-blue-d));
  padding: 20px;
}
.tp-login-card {
  background: var(--c-cream);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.28);
  border-top: 4px solid var(--c-gold);
}
.tp-login-card h1 {
  text-align: center;
  margin-bottom: 4px;
}
.tp-login-card .subtitle {
  text-align: center;
  color: var(--c-muted);
  margin-bottom: 18px;
  font-size: 0.9rem;
}
.tp-login-card .tp-btn { width: 100%; margin-top: 18px; }

/* ---------- Footer ---------- */
.tp-foot {
  text-align: center;
  font-size: 0.78rem;
  color: var(--c-muted);
  padding: 18px 12px 30px 12px;
}
