/* Training Recorder - shared WMS / ERP look */
:root {
  --onyx: #041E42; --brass: #C69214; --steel: #326295; --sterling: #5E8AB4;
  --caliche: #F2F2F4; --ink: #1c2b3a; --ink2: #5a6675; --ink3: #8b95a3;
  --line: #e3e5ea; --ok: #2e7d4f; --warn: #b26a00; --bad: #b3372c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Montserrat", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: var(--ink); background: var(--caliche);
}
/* Chrome: same sidebar + top bar as the WMS / ERP / CRM (navstyle.asp): sider 200px, header 56px,
   logo 72px, Midnight Onyx, Burnished Brass links, steel divider. */
.side {
  position: fixed; inset: 0 auto 0 0; width: 200px; background: var(--onyx); color: #fff;
  display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; overflow-y: auto; z-index: 20;
  border-right: 1px solid var(--steel);
}
.brand {
  display: block; color: var(--brass); font-size: 13px; font-weight: 700; text-align: center;
  letter-spacing: 5px; margin: 0 0 18px; text-decoration: none; padding: 0 !important;
}
.brand:hover { background: none !important; color: var(--brass) !important; }
.brand img { display: block; height: 72px; width: auto; max-width: 100%; margin: 0 auto 10px; object-fit: contain; }
.side .sect { color: var(--sterling); font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin: 14px 6px 4px; }
.side a {
  display: block; padding: 9px 14px; color: var(--brass); text-decoration: none; font-size: 13.5px;
  font-weight: 500; border-radius: 6px;
}
.side a:hover { background: rgba(255,255,255,.28); color: #fff; }
.side a.on { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
.side .foot { margin-top: auto; padding: 14px 6px 0; font-size: 11px; color: var(--sterling); }
.top {
  position: fixed; inset: 0 0 auto 200px; height: 56px; background: var(--onyx);
  display: flex; align-items: center; gap: 14px; padding: 0 20px; z-index: 10;
}
.top h1 { font-size: 15px; margin: 0; color: #fff; font-weight: 600; letter-spacing: .5px; white-space: nowrap; }
.top .crumb { color: var(--sterling); font-size: 12px; font-weight: 500; white-space: nowrap; }
.top .grow { flex: 1; }
.top .mnav { display: none; }
header.top input[type], header.top select {
  height: 32px; padding: 0 12px; border: 1px solid var(--steel); background: rgba(255,255,255,.08); color: #fff;
}
.top input::placeholder { color: rgba(255,255,255,.55); }
.top select option { color: var(--ink); background: #fff; }
header.top input[type]:focus, header.top select:focus { border-color: var(--sterling); box-shadow: 0 0 0 3px rgba(94,138,180,.3); }
.userchip { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; }
.userchip .avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brass); color: var(--onyx);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
@media (max-width: 1000px) { .userchip .uname { display: none; } }
.top .btn { padding: 7px 14px; }
.top .btn.ghost { background: transparent; color: #fff; border-color: var(--steel); }
.top .btn.ghost:hover { background: rgba(255,255,255,.12); }
main { margin-left: 200px; padding: 80px 24px 40px; }
.wrap { max-width: 1400px; margin: 0 auto; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 6px;
  border: 1px solid var(--onyx); background: var(--onyx); color: #fff; font: inherit; font-size: 13px;
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #0a2f5f; }
.btn.ghost { background: #fff; color: var(--onyx); border-color: #c9cfd8; }
.btn.ghost:hover { background: #eef3f9; }
.btn.brass { background: var(--brass); border-color: var(--brass); color: var(--onyx); }
.btn.brass:hover { background: #d9a524; border-color: #d9a524; }
.btn.danger { background: #fff; color: var(--bad); border-color: #e3c1bd; }
.btn.danger.armed { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.big { padding: 14px 26px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.on { background: var(--onyx); color: #fff; border-color: var(--onyx); }

input[type=text], input[type=search], input[type=number], select, textarea {
  font: inherit; font-size: 13px; color: var(--ink); background: #fff; border: 1px solid #c9cfd8;
  border-radius: 6px; padding: 8px 10px; outline: none; max-width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--steel); box-shadow: 0 0 0 3px rgba(50,98,149,.15); }
label.f { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); margin: 14px 0 5px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.muted { color: var(--ink2); } .small { font-size: 12px; }
.err { background: #f9e7e5; color: var(--bad); border-radius: 6px; padding: 10px 12px; margin: 12px 0; font-size: 13px; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.pill.brass { background: #f7efd8; color: #8a6710; } .pill.gray { background: #ededf0; color: var(--ink2); }
.pill.ok { background: #e3f1e9; color: var(--ok); } .pill.bad { background: #f9e7e5; color: var(--bad); }
.pill.steel { background: #e6eef7; color: var(--steel); }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid #c9cfd8; border-top-color: var(--steel); border-radius: 50%; animation: sp 0.8s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }

/* library */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.vcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit; display: block; }
.vcard:hover { border-color: var(--sterling); box-shadow: 0 4px 14px rgba(4,30,66,.10); }
.thumb { position: relative; aspect-ratio: 16/9; background: var(--onyx) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: #cfd8e6; font-size: 12px; }
.thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(4,30,66,.85); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.vcard .body { padding: 12px 14px 14px; }
.vcard h3 { margin: 0 0 6px; font-size: 14px; color: var(--onyx); overflow-wrap: anywhere; }
.vcard .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--ink2); }
.empty { text-align: center; padding: 70px 20px; }
.empty h2 { color: var(--onyx); margin: 0 0 8px; }

/* record */
.rec-box { max-width: 720px; margin: 0 auto; }
.timer { font-size: 54px; font-weight: 700; color: var(--onyx); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--bad); margin-right: 8px; animation: bl 1.2s ease-in-out infinite; }
.dot.paused { background: var(--ink3); animation: none; }
@keyframes bl { 50% { opacity: .25; } }
.meter { height: 8px; background: #e9ebf0; border-radius: 4px; overflow: hidden; max-width: 260px; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .1s; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.count { font-size: 96px; font-weight: 700; color: var(--brass); text-align: center; padding: 30px 0; }
#camPreview { width: 160px; border-radius: 8px; background: #000; display: none; margin-top: 10px; }
ol.steps { margin: 8px 0 0; padding-left: 20px; color: var(--ink2); line-height: 1.7; font-size: 13px; }

/* watch */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.player { background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; color: #cfd8e6; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.title-in { width: 100%; font-size: 20px !important; font-weight: 700; color: var(--onyx) !important; border-color: transparent !important; padding: 6px 8px !important; margin-left: -8px; background: transparent !important; }
.title-in:hover { border-color: #c9cfd8 !important; } .title-in:focus { background: #fff !important; border-color: var(--steel) !important; }
.seg { display: inline-flex; border: 1px solid #c9cfd8; border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; color: var(--onyx); cursor: pointer; }
.seg button.on { background: var(--onyx); color: #fff; }
.tpanel { position: sticky; top: 76px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; padding: 0; }
.tpanel h2 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.tbody { overflow-y: auto; padding: 14px 18px 18px; line-height: 1.75; font-size: 14px; }
.tbody p { margin: 0 0 12px; }
.tbody .ts { display: block; font-size: 11px; font-weight: 700; color: var(--steel); font-variant-numeric: tabular-nums; }
.tbody span.w { cursor: pointer; border-radius: 3px; padding: 1px 0; }
.tbody span.w:hover { background: #e6eef7; }
.tbody span.w.now { background: #f7efd8; }
.tbody span.w.fill { color: #a87b10; text-decoration: line-through; text-decoration-color: rgba(168,123,16,.6); }
.cleanbox { border-left: 4px solid var(--brass); }

@media (max-width: 1000px) { .watch { grid-template-columns: 1fr; } .tpanel { position: static; max-height: 480px; } }
@media (max-width: 800px) {
  .side { display: none; } .top { left: 0; padding: 0 16px; } .top .mnav { display: inline-flex; } .top .crumb { display: none; }
  main { margin-left: 0; padding: 72px 16px 32px; } .timer { font-size: 40px; }
}
