/* training.youngengineers.org — page-specific styles layered on top of the
   sales design system (assets/style.css + dark-mode.css). Only the bits that
   are unique to the training tracker live here; everything else (buttons,
   header chrome, sticky-chrome collapse, typography) comes from style.css. */

/* ---------------- Login ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: #eef5fb;
}
.login-box {
  max-width: 400px; width: 100%; text-align: center;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.10); padding: 34px 32px;
}
.login-logo { height: 46px; margin-bottom: 18px; }
.login-box h1 { font-size: 22px; margin: 0 0 6px; color: #0f172a; }
.login-sub { color: #64748b; margin: 0 0 22px; font-size: 14px; }
.login-err {
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  border-radius: 8px; padding: 9px 12px; font-size: 13px; margin: 0 0 16px;
}
.btn.ms-signin {
  background: #2f2f2f; color: #fff; border-color: #2f2f2f;
  padding: 11px 20px; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 10px;
}
.btn.ms-signin:hover { background: #1a1a1a; color: #fff; }
.dev-login { margin-top: 18px; font-size: 12px; color: #94a3b8; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.dev-login a { color: #159ad6; }
.login-apps { margin-top: 22px; display: flex; justify-content: center; }

/* ---------------- Header user chip ---------------- */
.brand-logo { height: 30px; }
.site-name {
  font-size: 16px; font-weight: 700; color: #0f172a;
  padding-left: 12px; margin-left: 2px; border-left: 1px solid #d8dee9;
}
.header-tools { margin-left: auto; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: #475569; }
.user-name { font-weight: 600; color: #1f2937; }
.role-pill {
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px;
  text-transform: uppercase; letter-spacing: .02em;
}
.role-admin { background: #e9f6fc; color: #0369a1; }
.role-trainer { background: #ecfdf5; color: #047857; }
.logout-link { color: #64748b; text-decoration: underline; }

/* ---------------- Page head ---------------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 18px 0 14px; }
.page-title { font-size: 20px; margin: 0 0 4px; color: #0f172a; }
.page-desc { margin: 0; color: #64748b; font-size: 13.5px; max-width: 640px; }
.page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-filter { padding: 7px 11px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; min-width: 180px; }
.help { color: #159ad6; cursor: help; border-bottom: 1px dotted currentColor; margin-left: 4px; }

/* ---------------- Table ---------------- */
.table-scroll { overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .05); }
.training-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.training-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: #f8fafc; text-align: left; padding: 10px 12px;
  border-bottom: 2px solid #e5e7eb; white-space: nowrap;
  font-weight: 700; color: #334155;
}
.th-label { margin-right: 6px; }
.th-tag { font-size: 9.5px; font-weight: 700; text-transform: uppercase; border-radius: 999px; padding: 1px 6px; vertical-align: middle; }
.th-admin { background: #eef2ff; color: #4338ca; }
.th-trainer { background: #ecfdf5; color: #047857; }
.th-del { border: none; background: none; color: #cbd5e1; font-size: 15px; cursor: pointer; line-height: 1; padding: 0 2px; }
.th-del:hover { color: #ef4444; }
.training-table tbody td { padding: 0; border-bottom: 1px solid #f1f5f9; border-right: 1px solid #f8fafc; }
.training-table tbody tr:hover td { background: #f9fafb; }
.cell { vertical-align: middle; }
.cell .cell-val { display: block; padding: 9px 12px; min-height: 36px; min-width: 90px; }
.cell .ph { color: #cbd5e1; }
.cell.editable { cursor: text; transition: background .12s; }
.cell.editable:hover { background: #eff6ff; box-shadow: inset 0 0 0 1px #bfdbfe; }
.cell.editable:focus { outline: 2px solid #159ad6; outline-offset: -2px; }
.cell.locked .cell-val { background: #fafafa; color: #64748b; }
.cell.saving { opacity: .55; }
.cell.editing { box-shadow: inset 0 0 0 2px #159ad6; }
.cell-input { width: 100%; box-sizing: border-box; border: none; padding: 8px 11px; font: inherit; font-size: 13px; background: #fff; }
.cell-input:focus { outline: none; }
.col-actions { text-align: center; white-space: nowrap; }
.row-del { border: 1px solid #fecaca; background: #fff; color: #dc2626; border-radius: 6px; padding: 4px 9px; font-size: 12px; cursor: pointer; }
.row-del:hover { background: #fef2f2; }
.empty-note { color: #94a3b8; font-size: 13px; margin: 16px 2px; }

/* ---------------- Toast ---------------- */
.saved-toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 5000;
  background: #10b981; color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; opacity: 0; transform: translateY(8px);
  transition: opacity .25s, transform .25s; pointer-events: none;
}
.saved-toast.show { opacity: 1; transform: translateY(0); }
.saved-toast.is-error { background: #ef4444; }

/* ---------------- Tooltip (data-tip) ---------------- */
.ye-tip {
  position: fixed; z-index: 6000; max-width: 260px;
  background: #0f172a; color: #fff; font-size: 12px; line-height: 1.4;
  padding: 7px 10px; border-radius: 7px; pointer-events: none;
  opacity: 0; transform: translateY(-4px); transition: opacity .14s, transform .14s;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .25);
}
.ye-tip.show { opacity: 1; transform: translateY(0); }

/* ---------------- Dark mode ---------------- */
body.dark .login-wrap { background: #0b1220; }
body.dark .login-box { background: #0f172a; border-color: #1e293b; box-shadow: 0 12px 34px rgba(0, 0, 0, .4); }
body.dark .login-box h1 { color: #f1f5f9; }
body.dark .site-name { color: #f1f5f9; border-left-color: #334155; }
body.dark .user-name { color: #e2e8f0; }
body.dark .page-title { color: #f1f5f9; }
body.dark .table-scroll { background: #0f172a; border-color: #1e293b; }
body.dark .training-table thead th { background: #111c33; color: #cbd5e1; border-bottom-color: #1e293b; }
body.dark .training-table tbody td { border-bottom-color: #16233c; border-right-color: #111c33; }
body.dark .training-table tbody tr:hover td { background: #16233c; }
body.dark .cell.editable:hover { background: #1e293b; box-shadow: inset 0 0 0 1px #334155; }
body.dark .cell.locked .cell-val { background: #0b1324; color: #94a3b8; }
body.dark .cell-input { background: #0f172a; color: #f1f5f9; }
body.dark .table-filter { background: #0f172a; border-color: #334155; color: #f1f5f9; }

@media (max-width: 700px) {
  .page-head { flex-direction: column; }
  .page-head-actions { width: 100%; }
  .table-filter { flex: 1; }
}
