:root {
  --eztm-black: #111111;
  --eztm-dark: #202124;
  --eztm-yellow: #ffd700;
  --eztm-yellow-soft: #fff7c2;
  --eztm-bg: #f3f4f6;
  --eztm-card: #ffffff;
  --eztm-line: #dfe3e8;
  --eztm-muted: #667085;
  --eztm-red: #c62828;
  --eztm-red-soft: #fff0f0;
  --eztm-orange: #b45309;
  --eztm-orange-soft: #fff7e6;
  --eztm-green: #087f5b;
  --eztm-green-soft: #e9fbf4;
  --eztm-blue: #1d4ed8;
  --eztm-blue-soft: #eff6ff;
  --eztm-radius: 12px;
  --eztm-shadow: 0 12px 30px rgba(17, 24, 39, .08);
}

.eztm-root,
.eztm-root * { box-sizing: border-box; }
.eztm-root { position: relative; width: 100%; min-height: 720px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--eztm-black); background: var(--eztm-bg); border-radius: 14px; overflow: hidden; }
.eztm-root button,
.eztm-root input,
.eztm-root select,
.eztm-root textarea { font: inherit; }
.eztm-root input,
.eztm-root select,
.eztm-root textarea { width: 100%; border: 1px solid #cfd4dc; border-radius: 8px; background: #fff; color: #111; padding: 10px 12px; outline: none; }
.eztm-root input:focus,
.eztm-root select:focus,
.eztm-root textarea:focus { border-color: #8a7400; box-shadow: 0 0 0 3px rgba(255, 215, 0, .22); }
.eztm-root label { display: block; margin: 12px 0 6px; font-size: .84rem; font-weight: 700; color: #344054; }
.eztm-root h2,
.eztm-root h3,
.eztm-root p { margin-top: 0; }
.eztm-root a { color: #0b57d0; }
.eztm-root .hidden { display: none !important; }
.eztm-muted { color: var(--eztm-muted); }

.eztm-loader { position: fixed; inset: 0; z-index: 999999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(0, 0, 0, .76); color: #fff; font-weight: 800; }
.eztm-spinner { width: 44px; height: 44px; border: 4px solid rgba(255,255,255,.25); border-top-color: var(--eztm-yellow); border-radius: 50%; animation: eztm-spin .8s linear infinite; }
@keyframes eztm-spin { to { transform: rotate(360deg); } }

.eztm-toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 1000000; display: grid; gap: 10px; pointer-events: none; }
.eztm-toast { min-width: 290px; max-width: 460px; padding: 14px 18px; border-left: 5px solid var(--eztm-blue); border-radius: 9px; background: #fff; box-shadow: 0 14px 34px rgba(0,0,0,.22); color: #222; opacity: 0; transform: translateY(12px); transition: .22s ease; }
.eztm-toast.show { opacity: 1; transform: translateY(0); }
.eztm-toast.success { border-left-color: var(--eztm-green); }
.eztm-toast.error { border-left-color: var(--eztm-red); }
.eztm-toast.info { border-left-color: var(--eztm-blue); }

.eztm-login-shell { min-height: 720px; display: grid; place-items: center; padding: 26px; background: radial-gradient(circle at top, #3a3a3a 0, #111 52%, #000 100%); }
.eztm-login-card { width: min(420px, 100%); padding: 34px; background: #fff; border-radius: 16px; box-shadow: 0 22px 60px rgba(0,0,0,.34); border-bottom: 7px solid var(--eztm-yellow); }
.eztm-brand { color: #fff; font-size: 1.55rem; font-weight: 900; letter-spacing: -.04em; }
.eztm-brand span { color: var(--eztm-yellow); }
.eztm-login-card .eztm-brand { color: #111; font-size: 2.2rem; }
.eztm-kicker { color: var(--eztm-yellow); text-transform: uppercase; letter-spacing: .16em; font-size: .76rem; font-weight: 900; }
.eztm-login-card .eztm-kicker { color: #7a6400; margin-bottom: 20px; }
.eztm-form-note { min-height: 22px; margin-top: 12px; color: var(--eztm-red); font-size: .85rem; }

.eztm-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px; background: #000; color: #fff; border-bottom: 4px solid var(--eztm-yellow); }
.eztm-user-box { display: flex; align-items: center; gap: 14px; text-align: right; }
.eztm-user-box strong,
.eztm-user-box small { display: block; }
.eztm-user-box small { margin-top: 2px; color: #c6c7ca; font-size: .76rem; }
.eztm-shell { min-height: 646px; display: grid; grid-template-columns: 225px minmax(0, 1fr); }
.eztm-nav { background: var(--eztm-dark); color: #d0d4da; padding: 14px 0 24px; }
.eztm-nav-item { width: 100%; border: 0; border-left: 4px solid transparent; background: transparent; color: inherit; text-align: left; padding: 13px 18px; cursor: pointer; font-weight: 700; }
.eztm-nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.eztm-nav-item.active { color: var(--eztm-yellow); background: rgba(255,255,255,.08); border-left-color: var(--eztm-yellow); }
.eztm-nav-heading { padding: 22px 18px 8px; color: #8d949e; font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; }
.eztm-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 5px; padding: 0 6px; border-radius: 999px; background: var(--eztm-red); color: #fff; font-size: .7rem; }
.eztm-main { min-width: 0; max-height: calc(100vh - 74px); overflow: auto; padding: 24px; background: var(--eztm-bg); }
.eztm-tab { display: none; }
.eztm-tab.active { display: block; animation: eztm-fade .18s ease; }
@keyframes eztm-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.eztm-page-head,
.eztm-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.eztm-page-head { margin-bottom: 18px; }
.eztm-page-head h2 { margin-bottom: 4px; font-size: clamp(1.35rem, 2vw, 1.85rem); }
.eztm-page-head p { color: var(--eztm-muted); }
.eztm-panel-head h3 { margin: 0; }
.eztm-panel { margin-bottom: 18px; padding: 18px; background: var(--eztm-card); border: 1px solid var(--eztm-line); border-radius: var(--eztm-radius); box-shadow: var(--eztm-shadow); }
.eztm-panel > summary { cursor: pointer; font-weight: 900; }
.eztm-panel > summary + * { margin-top: 18px; }

.eztm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; border: 1px solid transparent; border-radius: 8px; padding: 9px 14px; cursor: pointer; text-decoration: none !important; font-weight: 850; line-height: 1; white-space: nowrap; transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease; }
.eztm-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,.12); }
.eztm-btn:disabled { cursor: not-allowed; opacity: .55; transform: none; box-shadow: none; }
.eztm-btn-primary { background: var(--eztm-yellow); color: #111 !important; border-color: #b89d00; }
.eztm-btn-dark { background: #111; color: #fff !important; border-color: #111; }
.eztm-btn-light { background: #fff; color: #222 !important; border-color: #cfd4dc; }
.eztm-btn-danger { background: var(--eztm-red); color: #fff !important; border-color: var(--eztm-red); }
.eztm-btn-ghost { background: transparent; color: #fff !important; border-color: #5c5f64; }
.eztm-btn-small { min-height: 32px; padding: 7px 10px; font-size: .78rem; }
.eztm-btn-wide { width: 100%; margin-top: 14px; min-height: 48px; }
.eztm-icon-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f1f3f5; color: #111; font-size: 1.5rem; cursor: pointer; }
.eztm-inline { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.eztm-check { display: flex !important; align-items: center; gap: 8px; margin: 12px 0 !important; cursor: pointer; }
.eztm-check input { width: auto; margin: 0; }
.eztm-search { min-width: 220px; }

.eztm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.eztm-stat { min-height: 108px; display: flex; flex-direction: column; justify-content: center; padding: 18px; border-radius: 12px; background: #111; color: #fff; box-shadow: var(--eztm-shadow); }
.eztm-stat span { display: block; color: var(--eztm-yellow); font-size: 2rem; font-weight: 950; }
.eztm-stat small { text-transform: uppercase; letter-spacing: .09em; color: #d8d8d8; font-size: .7rem; font-weight: 800; }
.eztm-stat.danger span { color: #ff8f8f; }
.eztm-stat.warning span { color: #ffd166; }
.eztm-stat.success span { color: #70e1b5; }

.eztm-action-list { display: grid; gap: 10px; margin-top: 14px; }
.eztm-action-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--eztm-line); border-left: 6px solid var(--eztm-blue); border-radius: 9px; background: #fff; }
.eztm-action-card strong,
.eztm-action-card span { display: block; }
.eztm-action-card span { margin-top: 4px; color: var(--eztm-muted); font-size: .82rem; }
.eztm-action-card.overdue,
.eztm-action-card.expired { border-left-color: var(--eztm-red); }
.eztm-action-card.expiring-soon { border-left-color: var(--eztm-orange); }
.eztm-action-card.assigned { border-left-color: var(--eztm-blue); }
.eztm-action-card.qc { border-left-color: var(--eztm-yellow); }

.eztm-table-wrap { width: 100%; overflow: auto; }
.eztm-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 12px; font-size: .86rem; }
.eztm-table th { position: sticky; top: 0; z-index: 2; background: #f4f5f7; color: #344054; text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.eztm-table th,
.eztm-table td { padding: 11px 10px; border-bottom: 1px solid #e7e9ed; vertical-align: top; }
.eztm-table td strong,
.eztm-table td small,
.eztm-table th strong,
.eztm-table th small { display: block; }
.eztm-table td small,
.eztm-table th small { margin-top: 3px; color: var(--eztm-muted); font-size: .75rem; }
.eztm-table tr:hover td { background: #fbfcfd; }
.eztm-table code { display: block; max-width: 420px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .72rem; }
.eztm-empty { padding: 22px; text-align: center; color: var(--eztm-muted); }
.eztm-link { display: inline-block; padding: 6px; font-size: .78rem; font-weight: 800; }

.eztm-status { display: inline-flex; align-items: center; justify-content: center; padding: 5px 8px; border-radius: 999px; background: #eceff3; color: #3b4250; font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .03em; }
.eztm-status.complete { background: var(--eztm-green-soft); color: var(--eztm-green); }
.eztm-status.overdue,
.eztm-status.expired { background: var(--eztm-red-soft); color: var(--eztm-red); }
.eztm-status.expiring-soon { background: var(--eztm-orange-soft); color: var(--eztm-orange); }
.eztm-status.assigned { background: var(--eztm-blue-soft); color: var(--eztm-blue); }
.eztm-status.archived,
.eztm-status.unassigned { background: #eceff3; color: #667085; }
.eztm-pill { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; background: var(--eztm-yellow-soft); color: #695600; font-size: .7rem; font-weight: 900; text-transform: uppercase; }

.eztm-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.eztm-qc-card { padding: 18px; border: 1px solid var(--eztm-line); border-radius: var(--eztm-radius); background: #fff; box-shadow: var(--eztm-shadow); }
.eztm-qc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.eztm-qc-head h3 { margin: 8px 0 0; }
.eztm-qc-card dl { display: grid; grid-template-columns: 90px 1fr; gap: 7px 12px; margin: 17px 0; font-size: .84rem; }
.eztm-qc-card dt { color: var(--eztm-muted); font-weight: 800; }
.eztm-qc-card dd { margin: 0; }

.eztm-filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; padding: 13px; border: 1px solid var(--eztm-line); border-radius: 10px; background: #fff; }
.eztm-filter-bar select,
.eztm-filter-bar input { width: auto; min-width: 190px; }
.eztm-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.eztm-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.eztm-segmented { display: flex; gap: 4px; padding: 4px; border-radius: 9px; background: #eceff3; }
.eztm-segmented button { flex: 1; border: 0; border-radius: 7px; padding: 10px; background: transparent; cursor: pointer; font-weight: 800; }
.eztm-segmented button.active { background: #111; color: #fff; }
.eztm-target-panel { margin-top: 15px; }
.eztm-check-list { max-height: 360px; overflow: auto; margin-top: 12px; border: 1px solid var(--eztm-line); border-radius: 9px; background: #fff; }
.eztm-employee-option { display: flex !important; align-items: center; gap: 10px; margin: 0 !important; padding: 10px 12px; border-bottom: 1px solid #eceff3; cursor: pointer; }
.eztm-employee-option:last-child { border-bottom: 0; }
.eztm-employee-option:hover { background: #fafafa; }
.eztm-employee-option input { width: auto; margin: 0; }
.eztm-employee-option span,
.eztm-employee-option strong,
.eztm-employee-option small { display: block; }
.eztm-employee-option small { margin-top: 2px; color: var(--eztm-muted); font-size: .74rem; }

.eztm-matrix-wrap { max-height: 68vh; overflow: auto; margin-top: 16px; border: 1px solid var(--eztm-line); }
.eztm-matrix-table { border-collapse: separate; border-spacing: 0; min-width: 100%; background: #fff; font-size: .72rem; }
.eztm-matrix-table th,
.eztm-matrix-table td { min-width: 84px; height: 84px; border-right: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; text-align: center; }
.eztm-matrix-table thead th { position: sticky; top: 0; z-index: 4; height: 140px; background: #f8f9fa; }
.eztm-matrix-table .eztm-sticky-col { position: sticky; left: 0; z-index: 5; min-width: 180px; padding: 10px; background: #fff; text-align: left; box-shadow: 2px 0 0 #e5e7eb; }
.eztm-matrix-table thead .eztm-sticky-col { z-index: 8; background: #f8f9fa; }
.eztm-vertical-label { display: inline-block; max-width: 120px; writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; }
.eztm-matrix-cell { cursor: pointer; }
.eztm-matrix-cell:hover { outline: 3px solid rgba(0,0,0,.12); outline-offset: -3px; }
.eztm-matrix-cell > span { display: block; font-size: 1.4rem; font-weight: 950; }
.eztm-matrix-cell > small { display: block; margin-top: 4px; font-size: .6rem; }
.eztm-matrix-cell.complete { background: var(--eztm-green-soft); color: var(--eztm-green); }
.eztm-matrix-cell.expiring-soon { background: var(--eztm-orange-soft); color: var(--eztm-orange); }
.eztm-matrix-cell.expired,
.eztm-matrix-cell.overdue { background: var(--eztm-red-soft); color: var(--eztm-red); }
.eztm-matrix-cell.assigned { background: var(--eztm-blue-soft); color: var(--eztm-blue); }
.eztm-matrix-cell.unassigned { background: #f7f7f8; color: #b0b5bd; }
.eztm-legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 12px; background: #fff; font-weight: 800; }
.eztm-legend .complete { color: var(--eztm-green); }
.eztm-legend .expiring-soon { color: var(--eztm-orange); }
.eztm-legend .expired,
.eztm-legend .overdue { color: var(--eztm-red); }
.eztm-legend .assigned { color: var(--eztm-blue); }
.eztm-legend .unassigned { color: #7d8490; }

.eztm-preview-email { padding: 12px 0; border-bottom: 1px solid var(--eztm-line); }
.eztm-preview-email:last-child { border-bottom: 0; }
.eztm-preview-email strong,
.eztm-preview-email small { display: block; }
.eztm-preview-email small { color: var(--eztm-muted); }
.eztm-preview-email ul { margin-bottom: 0; }
.eztm-health { display: grid; grid-template-columns: 170px 1fr; gap: 10px 14px; }
.eztm-health dt { font-weight: 800; color: #344054; }
.eztm-health dd { margin: 0; }
.eztm-health .ok { color: var(--eztm-green); font-weight: 900; }
.eztm-health .bad { color: var(--eztm-red); font-weight: 900; }

.eztm-workbook-import { display: grid; gap: 14px; margin-top: 15px; }
.eztm-dropzone { position: relative; display: grid; place-items: center; gap: 7px; min-height: 170px; padding: 24px; border: 2px dashed #aeb4be; border-radius: 12px; background: #fafbfc; text-align: center; overflow: hidden; }
.eztm-dropzone:hover { border-color: #8a7400; background: #fffdf0; }
.eztm-dropzone input[type="file"] { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.eztm-dropzone strong { font-size: 1.05rem; }
.eztm-dropzone span { max-width: 650px; color: var(--eztm-muted); font-size: .8rem; }
.eztm-import-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.eztm-import-total { padding: 15px; border-radius: 10px; background: var(--eztm-green-soft); color: var(--eztm-green); }
.eztm-import-total.warning { background: var(--eztm-orange-soft); color: var(--eztm-orange); }
.eztm-import-total strong,
.eztm-import-total span { display: block; }
.eztm-import-total strong { font-size: 1.7rem; }
.eztm-import-total span { font-size: .76rem; font-weight: 850; text-transform: uppercase; }
.eztm-import-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 14px; }
.eztm-import-card { display: grid; gap: 9px; padding: 13px; border: 1px solid var(--eztm-line); border-radius: 9px; background: #fafbfc; }
.eztm-import-card input { padding: 7px; font-size: .76rem; }
.eztm-legacy-import { margin-top: 14px; }
.eztm-legacy-import summary { cursor: pointer; font-weight: 850; }
.eztm-result { max-height: 360px; overflow: auto; margin-top: 14px; padding: 14px; border-radius: 8px; background: #111; color: #d7f8e9; font-size: .74rem; white-space: pre-wrap; }
.eztm-callout { margin-top: 14px; padding: 13px 15px; border: 1px solid #cdd5df; border-left: 5px solid var(--eztm-blue); border-radius: 8px; background: var(--eztm-blue-soft); }
.eztm-callout.warning { border-left-color: var(--eztm-orange); background: var(--eztm-orange-soft); }
.eztm-callout.danger { border-left-color: var(--eztm-red); background: var(--eztm-red-soft); }
.eztm-callout.success { border-left-color: var(--eztm-green); background: var(--eztm-green-soft); }
.eztm-callout ul { margin-bottom: 0; }

.eztm-modal { width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 32px); overflow: auto; border: 0; border-radius: 13px; padding: 0; box-shadow: 0 24px 70px rgba(0,0,0,.34); }
.eztm-modal::backdrop { background: rgba(0,0,0,.66); }
.eztm-modal form { padding: 20px; }
.eztm-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 12px; border-bottom: 1px solid var(--eztm-line); }
.eztm-modal-head h3 { margin: 0; }
.eztm-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@media (max-width: 1000px) {
  .eztm-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .eztm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eztm-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .eztm-root { border-radius: 0; }
  .eztm-header { align-items: flex-start; }
  .eztm-user-box { align-items: flex-end; flex-direction: column; gap: 7px; }
  .eztm-shell { display: block; }
  .eztm-nav { position: sticky; top: 0; z-index: 30; display: flex; gap: 2px; overflow-x: auto; padding: 0; }
  .eztm-nav > *,
  .eztm-nav #eztm-manager-nav { display: contents; }
  .eztm-nav-heading { display: none; }
  .eztm-nav-item { width: auto; min-width: max-content; border-left: 0; border-bottom: 4px solid transparent; padding: 13px 14px; }
  .eztm-nav-item.active { border-left: 0; border-bottom-color: var(--eztm-yellow); }
  .eztm-main { max-height: none; padding: 14px; }
  .eztm-page-head,
  .eztm-panel-head { align-items: stretch; flex-direction: column; }
  .eztm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eztm-stat { min-height: 92px; }
  .eztm-stat span { font-size: 1.65rem; }
  .eztm-action-card { align-items: stretch; flex-direction: column; }
  .eztm-action-card .eztm-btn { width: 100%; }
  .eztm-filter-bar { align-items: stretch; flex-direction: column; }
  .eztm-filter-bar select,
  .eztm-filter-bar input,
  .eztm-search { width: 100%; min-width: 0; }
  .eztm-two-col { grid-template-columns: 1fr; }
  .eztm-import-summary { grid-template-columns: 1fr; }
  .eztm-modal-actions { flex-direction: column-reverse; }
  .eztm-modal-actions .eztm-btn { width: 100%; }
  .eztm-toast-stack { right: 10px; left: 10px; bottom: 10px; }
  .eztm-toast { min-width: 0; max-width: none; }
}

@media (max-width: 430px) {
  .eztm-header { flex-direction: column; }
  .eztm-user-box { width: 100%; align-items: stretch; text-align: left; }
  .eztm-user-box .eztm-btn { width: 100%; }
  .eztm-stats { grid-template-columns: 1fr 1fr; }
  .eztm-panel { padding: 14px; }
  .eztm-segmented { overflow-x: auto; }
  .eztm-segmented button { min-width: max-content; }
}

@media print {
  .eztm-nav,
  .eztm-header,
  .eztm-btn,
  .eztm-filter-bar { display: none !important; }
  .eztm-main { max-height: none; overflow: visible; padding: 0; }
  .eztm-panel { box-shadow: none; break-inside: avoid; }
}

.eztm-record-actions { display: grid; gap: 10px; margin-top: 18px; }
.eztm-record-actions .eztm-btn { width: 100%; min-height: 44px; }

/* Direct-source handbook publisher in the manager catalog. */
.eztm-handbook-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 22px;
  align-items: center;
  border-left: 4px solid #f3cf24;
}
.eztm-handbook-copy h3 { margin: 4px 0 8px; }
.eztm-handbook-copy p { margin: 0; line-height: 1.55; }
.eztm-handbook-status { margin-top: 14px; font-size: 13px; line-height: 1.5; }
.eztm-handbook-actions { display: grid; gap: 12px; }
.eztm-handbook-actions .eztm-check { align-items: flex-start; }
@media (max-width: 760px) {
  .eztm-handbook-card { grid-template-columns: 1fr; }
}
