/* ACE Global Depository — Employee Portal
   Design tokens first, then layout, then components. */

:root {
  --navy-900: #0b1b33;
  --navy-800: #10254380;
  --navy-700: #16305a;
  --navy-600: #1e3d70;
  /* Brand palette, sampled from the ACE Global Depository logo. */
  --brand-blue: #004c9f;
  --brand-blue-dark: #003a7a;
  --brand-green: #43a838;
  --brand-grey: #707070;

  --gold-500: #c8a24a;
  --gold-400: #d9b86c;
  --gold-100: #f6efdd;

  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #dfe4ee;
  --border-strong: #c6cee0;
  --text: #142033;
  --text-muted: #5b6880;
  --text-faint: #8a94a8;

  --green-600: #1a7f4b;
  --green-100: #e2f4ea;
  --amber-600: #9a6700;
  --amber-100: #fdf3d7;
  --red-600: #b42318;
  --red-100: #fdeceb;
  --blue-600: #1c5fbf;
  --blue-100: #e7effd;
  --grey-100: #eef1f6;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 37, 67, .06), 0 1px 3px rgba(16, 37, 67, .04);
  --shadow-md: 0 4px 12px rgba(16, 37, 67, .08);
  --shadow-lg: 0 18px 48px rgba(11, 27, 51, .22);
  --sidebar-w: 254px;
  --header-h: 60px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------- auth ---------------------------------- */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--navy-900);
}

.auth-brand {
  padding: 56px 60px;
  color: #fff;
  background:
    radial-gradient(1000px 500px at 10% -10%, #1e3d70 0%, transparent 60%),
    linear-gradient(160deg, #0b1b33 0%, #102543 60%, #16305a 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-brand__mark { display: block; }
.auth-brand h1 { font-size: 34px; line-height: 1.15; margin-bottom: 14px; }
.auth-brand p { color: #b7c4da; max-width: 46ch; font-size: 15px; }
.auth-brand__features { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; }
.auth-brand__features li { color: #cdd8ea; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.auth-brand__features svg { flex: none; margin-top: 2px; color: var(--gold-400); }
.auth-brand__foot { color: #7f8ea9; font-size: 12px; }

.auth-panel {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  overflow-y: auto;
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 22px; margin-bottom: 6px; }
.auth-card__sub { color: var(--text-muted); margin-bottom: 24px; }
.auth-switch { margin-top: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ------------------------------ app shell ------------------------------ */

.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, #0b1b33 0%, #102543 100%);
  color: #c4d0e4;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.sidebar__brand {
  display: block;
  padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff; text-decoration: none;
}
.sidebar__brand:hover { text-decoration: none; }
.sidebar__brand:hover .logo-plate { box-shadow: 0 0 0 2px var(--gold-500); }
.sidebar__brand-sub {
  display: block; margin-top: 8px;
  font-size: 10px; color: #8fa1bd; letter-spacing: .12em; text-transform: uppercase;
}
.sidebar__nav {
  padding: 12px 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* An administrator sees every module, so the menu overflows on a laptop screen.
   Keep the scrollbar visible against the dark panel or the items below the fold
   look like they are simply missing. */
.sidebar__nav { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.28) transparent; }
.sidebar__nav::-webkit-scrollbar { width: 8px; }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.22);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.sidebar__nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.4); background-clip: content-box; }
.sidebar__group { margin-bottom: 4px; }
.sidebar__label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  color: #64789a; padding: 14px 10px 6px;
}
.sidebar a.navlink {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: #c4d0e4; font-size: 13.5px; text-decoration: none; margin-bottom: 1px;
}
.sidebar a.navlink:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar a.navlink.is-active { background: var(--gold-500); color: #16233a; font-weight: 600; }
.sidebar a.navlink.is-active svg { color: #16233a; }
.sidebar a.navlink svg { flex: none; color: #8fa1bd; }
.navlink__badge {
  margin-left: auto; background: var(--red-600); color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 20px;
}
.navlink.is-active .navlink__badge { background: #16233a; color: #fff; }
.sidebar__foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11px; color: #64789a; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-size: 15px; font-weight: 600; }
.topbar__crumb { color: var(--text-faint); font-size: 12px; }
.topbar__spacer { flex: 1; }
.menu-toggle { display: none; }

.usermenu { position: relative; }
.usermenu__button {
  display: flex; align-items: center; gap: 9px; background: none; border: 1px solid transparent;
  padding: 5px 8px; border-radius: 30px; cursor: pointer; font: inherit;
}
.usermenu__button:hover { background: var(--grey-100); }
.usermenu__meta { text-align: right; line-height: 1.25; }
.usermenu__meta strong { display: block; font-size: 13px; }
.usermenu__meta span { font-size: 11px; color: var(--text-muted); }
.usermenu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 234px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 6px; z-index: 60;
}
.usermenu__panel button, .usermenu__panel a {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: none; border: 0; padding: 8px 10px; border-radius: var(--radius-sm);
  font: inherit; font-size: 13px; color: var(--text); cursor: pointer; text-decoration: none;
}
.usermenu__panel button:hover, .usermenu__panel a:hover { background: var(--grey-100); }
.usermenu__panel hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--navy-700); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.avatar--lg { width: 52px; height: 52px; font-size: 18px; }
.avatar--sm { width: 26px; height: 26px; font-size: 10px; }

.content { padding: 22px; max-width: 1440px; width: 100%; }

/* ------------------------------- layout -------------------------------- */

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head__text { flex: 1; min-width: 240px; }
.page-head p { color: var(--text-muted); margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row--end { justify-content: flex-end; }
.stack { display: grid; gap: 14px; }
.spacer { flex: 1; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card__head {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card__head h2 { flex: 1; min-width: 140px; }
.card__head p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-muted); }
.card__body { padding: 16px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.stat { padding: 15px 16px; }
.stat__label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.stat__value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.stat__hint { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.stat--accent { border-left: 3px solid var(--gold-500); }

.empty { padding: 40px 20px; text-align: center; color: var(--text-muted); }
.empty svg { color: var(--border-strong); margin-bottom: 10px; }
.empty h3 { margin-bottom: 4px; color: var(--text); }

/* ------------------------------- tables -------------------------------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); font-weight: 600; padding: 10px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tr.is-clickable { cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: 12px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--text-muted); }

/* ------------------------------- badges -------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
  background: var(--grey-100); color: var(--text-muted); white-space: nowrap;
}
.badge--green { background: var(--green-100); color: var(--green-600); }
.badge--amber { background: var(--amber-100); color: var(--amber-600); }
.badge--red { background: var(--red-100); color: var(--red-600); }
.badge--blue { background: var(--blue-100); color: var(--blue-600); }
.badge--gold { background: var(--gold-100); color: #8a6d1f; }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ------------------------------ controls ------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, opacity .12s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-faint); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--navy-600); border-color: var(--navy-600); }
.btn--gold { background: var(--gold-500); border-color: var(--gold-500); color: #16233a; }
.btn--gold:hover:not(:disabled) { background: var(--gold-400); border-color: var(--gold-400); }
.btn--danger { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.btn--danger:hover:not(:disabled) { opacity: .9; }
.btn--success { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.btn--success:hover:not(:disabled) { opacity: .9; }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover:not(:disabled) { background: var(--grey-100); }
.btn--sm { padding: 5px 10px; font-size: 12.5px; }
.btn--block { width: 100%; }
.btn--lg { padding: 11px 18px; font-size: 15px; }

.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.field__hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.field__error { font-size: 12px; color: var(--red-600); margin-top: 4px; }
.field--inline { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.field--inline > label { margin: 0; font-weight: 500; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], input[type="tel"], select, textarea {
  width: 100%; padding: 8px 11px; font: inherit; font-size: 13.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(30, 61, 112, .12);
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--red-600); box-shadow: 0 0 0 3px rgba(180, 35, 24, .1);
}
input:disabled, select:disabled, textarea:disabled { background: var(--grey-100); color: var(--text-muted); }
textarea { resize: vertical; min-height: 78px; }
input[type="checkbox"], input[type="radio"] { width: 15px; height: 15px; accent-color: var(--navy-700); cursor: pointer; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%235b6880' stroke-width='1.6' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

.toolbar {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.toolbar input[type="search"], .toolbar select { width: auto; min-width: 170px; }

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 9px 14px; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--navy-700); border-bottom-color: var(--gold-500); }
.tab__count { font-size: 11px; background: var(--grey-100); border-radius: 10px; padding: 0 6px; margin-left: 5px; }

.progress { height: 6px; background: var(--grey-100); border-radius: 4px; overflow: hidden; min-width: 70px; }
.progress__bar { height: 100%; background: var(--navy-600); border-radius: 4px; transition: width .25s; }
.progress__bar--green { background: var(--green-600); }
.progress__bar--amber { background: var(--amber-600); }

.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.alert {
  padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px;
  border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 14px;
}
.alert--error { background: var(--red-100); border-color: #f3c3bf; color: #8a1b13; }
.alert--success { background: var(--green-100); border-color: #b6e2c9; color: #10603a; }
.alert--warn { background: var(--amber-100); border-color: #efd89a; color: #7a5200; }
.alert--info { background: var(--blue-100); border-color: #c3d8fa; color: #164b99; }

/* ------------------------------- modal --------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(11, 27, 51, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 100; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; animation: modal-in .14s ease-out;
}
.modal--wide { max-width: 860px; }
.modal--narrow { max-width: 420px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.modal__head { padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.modal__head h2 { flex: 1; }
.modal__body { padding: 18px; max-height: calc(100vh - 220px); overflow-y: auto; }
.modal__foot { padding: 13px 18px; border-top: 1px solid var(--border); display: flex; gap: 9px; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.icon-btn { background: none; border: 0; padding: 5px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted); display: grid; place-items: center; }
.icon-btn:hover { background: var(--grey-100); color: var(--text); }

/* ------------------------------- toasts -------------------------------- */

.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 9px; z-index: 200; max-width: 360px; }
.toast {
  background: var(--navy-900); color: #fff; padding: 11px 15px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start;
  animation: toast-in .16s ease-out;
}
.toast--error { background: var(--red-600); }
.toast--success { background: var(--green-600); }
@keyframes toast-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* ----------------------------- module bits ----------------------------- */

.course-card { display: flex; flex-direction: column; }
.course-card__top { padding: 15px 16px 12px; flex: 1; }
.course-card__code { font-size: 11.5px; letter-spacing: .05em; color: var(--text-faint); font-weight: 600; }
.course-card h3 { margin: 4px 0 6px; font-size: 15px; }
.course-card p { font-size: 13px; color: var(--text-muted); margin: 0; }
.course-card__foot { padding: 11px 16px; border-top: 1px solid var(--border); display: flex; gap: 9px; align-items: center; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.lesson { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.lesson__head { padding: 12px 14px; background: var(--surface-2); display: flex; gap: 11px; align-items: center; cursor: pointer; }
.lesson__num { width: 24px; height: 24px; border-radius: 50%; background: var(--navy-700); color: #fff; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none; }
.lesson__head h3 { flex: 1; font-size: 14px; }
.lesson__body { padding: 14px; font-size: 13.5px; line-height: 1.65; color: var(--text); border-top: 1px solid var(--border); }

.question { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.question__text { font-weight: 600; margin-bottom: 10px; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; }
.option:hover { background: var(--surface-2); }
.option.is-selected { background: var(--blue-100); border-color: #c3d8fa; }
.option.is-correct { background: var(--green-100); border-color: #b6e2c9; }
.option.is-wrong { background: var(--red-100); border-color: #f3c3bf; }

.certificate {
  border: 2px solid var(--gold-500); border-radius: var(--radius); padding: 34px;
  background: linear-gradient(160deg, #fffdf7 0%, #fdf8ec 100%); text-align: center;
}
.certificate__logo { width: 100%; max-width: 300px; height: auto; margin: 0 auto 18px; display: block; }
.certificate__org { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: #8a6d1f; }
.certificate h2 { font-size: 24px; margin: 12px 0 6px; }
.certificate__name { font-size: 30px; font-weight: 700; color: var(--navy-900); margin: 16px 0 6px; }
.certificate__course { font-size: 17px; font-weight: 600; margin: 10px 0; }
.certificate__meta { display: flex; justify-content: center; gap: 34px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--gold-500); flex-wrap: wrap; font-size: 12.5px; }
.certificate__meta div span { display: block; color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.certificate__meta div strong { font-size: 13.5px; }

/*
 * The Certificate of Training, laid over ACE's design (1600 × 1131, A4
 * landscape). Positions are fractions of the sheet and type is in cqw — 1% of
 * the sheet's width — so the text sits where the design puts it at any size,
 * on screen and on paper.
 */
.cert-sheet {
  position: relative; width: 100%; max-width: 1120px; aspect-ratio: 1600 / 1131;
  container-type: inline-size; overflow: hidden; background: #fff;
  border-radius: var(--radius); box-shadow: 0 1px 3px rgba(15, 30, 60, .12), 0 8px 24px rgba(15, 30, 60, .08);
  color: #111; font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.cert-sheet__art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cert-sheet > div { position: absolute; right: 7.06%; text-align: right; line-height: 1; }
.cert-sheet__awarded { top: 47.3%; right: 6.94% !important; font-size: 1.88cqw; font-weight: 500; letter-spacing: .055em; }
.cert-sheet__name {
  top: 51.15%; height: 13.6%; left: 37%; right: 6.81% !important;
  display: flex; align-items: center; justify-content: flex-end; white-space: nowrap;
}
.cert-sheet__name span {
  font-family: 'Great Vibes', 'Edwardian Script ITC', 'Brush Script MT', cursive;
  font-size: 7.8cqw; color: #22223a; line-height: 1.25;
}
.cert-sheet__course {
  top: 66.1%; left: 38%; font-size: 2.06cqw; font-style: italic; font-weight: 400; line-height: 1.333 !important;
}
.cert-sheet__course strong { font-weight: 700; }
.cert-sheet__date { top: 85.87%; right: 4.375% !important; display: flex; align-items: flex-end; gap: 2.1cqw; }
.cert-sheet__date-label { font-size: 2.6cqw; font-weight: 700; letter-spacing: .1em; padding-bottom: .925cqw; }
.cert-sheet__date-value {
  font-family: 'Space Mono', 'Consolas', 'Courier New', monospace; font-size: 2.5cqw; letter-spacing: 0;
  min-width: 24cqw; text-align: left; padding: 0 0 .825cqw .1cqw; border-bottom: .38cqw solid #111;
}
.cert-sheet__ref { top: 95.2%; right: 4.3% !important; font-size: .95cqw; color: #8a94a6; letter-spacing: .03em; }
.cert-details { margin-top: 16px; max-width: 1120px; }
.cert-details .certificate__meta { justify-content: flex-start; margin-top: 0; padding-top: 0; border-top: 0; }

/* Printing a certificate prints the certificate: one A4 landscape sheet. */
@page certificate { size: A4 landscape; margin: 0; }
@media print {
  .cert-view .page-head, .cert-view > .alert, .cert-view .cert-details, .cert-view .cert-admin { display: none !important; }
  .cert-view .cert-sheet { page: certificate; width: 297mm; height: 210mm; max-width: none; border-radius: 0; box-shadow: none; break-inside: avoid; }
}

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline__item { position: relative; padding-bottom: 16px; }
.timeline__item::before {
  content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong);
}
.timeline__item.is-done::before { background: var(--green-600); border-color: var(--green-600); }
.timeline__item.is-overdue::before { background: var(--red-600); border-color: var(--red-600); }

.checkitem { display: flex; gap: 11px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--border); }
.checkitem:last-child { border-bottom: 0; }
.checkitem__main { flex: 1; min-width: 0; }
.checkitem__title { font-weight: 600; }
.checkitem.is-done .checkitem__title { text-decoration: line-through; color: var(--text-muted); }

.matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.matrix th, .matrix td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.matrix th { background: var(--surface-2); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }
.matrix td:first-child { text-align: left; }
.matrix th:not(:first-child), .matrix td:not(:first-child) { text-align: center; width: 110px; }
.matrix tbody tr:hover { background: var(--surface-2); }
.matrix__group td { background: var(--navy-900); color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }

.linechart { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.linechart__bar { flex: 1; background: var(--navy-600); border-radius: 3px 3px 0 0; min-height: 3px; position: relative; }
.linechart__bar span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 10.5px; color: var(--text-faint); }

.skeleton { background: linear-gradient(90deg, var(--grey-100) 25%, #f7f9fc 50%, var(--grey-100) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.loading-block { height: 78px; margin-bottom: 12px; }


/* -------------------------------- brand -------------------------------- */

.logo-plate {
  display: block;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  line-height: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .16);
}
.logo-plate img { width: 100%; height: auto; display: block; }
.logo-plate--lg { padding: 14px 18px; max-width: 340px; }

/* --------------------------- training material ------------------------- */

.media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b1b33;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 8px;
}
.media-frame video,
.media-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

.resources { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.resources__label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); font-weight: 600; margin-bottom: 8px;
}
.resource {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: inherit; text-decoration: none; font-size: 13.5px; background: var(--surface);
}
.resource:hover { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; }
.resource svg { flex: none; color: var(--text-muted); }
.resource__label { flex: 1; font-weight: 500; overflow-wrap: anywhere; }

.editor-block { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.editor-block__label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); font-weight: 600; margin-bottom: 7px;
}

/* ------------------------- approval chain trail ------------------------ */

.chain { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0; }
.chain__step { display: flex; gap: 10px; align-items: flex-start; flex: 1; min-width: 150px; }
.chain__link { flex: none; width: 26px; height: 2px; background: var(--border-strong); margin: 13px 6px 0; }
.chain__mark {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: var(--grey-100); color: var(--text-muted); border: 1px solid var(--border-strong);
}
.chain__mark--green { background: var(--green-100); color: var(--green-600); border-color: #b6e2c9; }
.chain__mark--amber { background: var(--amber-100); color: var(--amber-600); border-color: #efd89a; }
.chain__mark--red { background: var(--red-100); color: var(--red-600); border-color: #f3c3bf; }
.chain__mark--blue { background: var(--blue-100); color: var(--blue-600); border-color: #bcd3f6; }
.chain__body { min-width: 0; }
.chain__label { font-size: 13px; font-weight: 600; }
.chain__who { font-size: 11.5px; color: var(--text-muted); }
.chain__note { font-size: 11.5px; color: var(--text-muted); font-style: italic; margin-top: 2px; overflow-wrap: anywhere; }
.chain__step--upcoming .chain__label, .chain__step--skipped .chain__label { color: var(--text-faint); font-weight: 500; }

/* Below this a four-step chain wraps mid-row and leaves a dangling connector,
   so it stacks instead — which reads better on a narrow screen anyway. */
@media (max-width: 860px) {
  .chain { flex-direction: column; gap: 10px; }
  .chain__link { display: none; }
}

/* ----------------------------- responsive ------------------------------ */

@media (max-width: 1000px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 90;
    transform: translateX(-100%); transition: transform .18s ease-out;
  }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-toggle { display: grid; }
  .scrim { position: fixed; inset: 0; background: rgba(11, 27, 51, .45); z-index: 80; }
  .content { padding: 16px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; font-size: 12px; }
  .usermenu__meta { display: none; }
}

@media print {
  .sidebar, .topbar, .page-actions, .toasts, .modal__foot { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 0; }
}
