/* 395차: self-contained visual system for education training e-signatures. */
.te-modal-backdrop[hidden], .te-root [hidden] {display:none !important}
.te-modal-backdrop {position:fixed;z-index:30050;inset:0;display:flex;justify-content:center;align-items:center;padding:22px;background:rgba(14,29,59,.58);backdrop-filter:blur(6px);overflow:auto}
.te-mode-dialog, .te-pad-dialog {position:relative;width:min(640px,100%);box-sizing:border-box;background:#fff;border:1px solid #dbe5f2;border-radius:20px;box-shadow:0 32px 90px #091c3f55;padding:36px;color:#243653}
.te-mode-kicker,.te-eyebrow {font-size:11px;font-weight:800;letter-spacing:.15em;color:#41719c}
.te-mode-dialog h2,.te-pad-dialog h2 {font-size:24px;color:#172b4d;margin:9px 35px 8px 0;letter-spacing:-.7px;line-height:1.4}
.te-mode-description,.te-pad-dialog>p {color:#687990;margin:0 0 24px;font-size:13px;line-height:1.7}
.te-icon-close {position:absolute;right:19px;top:17px;width:35px;height:35px;border-radius:50% !important;background:#f1f5f9 !important;color:#58708c !important;border:0 !important;font-size:24px !important;line-height:1 !important;padding:0 !important}
.te-mode-options {display:grid;gap:14px}
.te-mode-option {width:100%;display:flex;align-items:center;text-align:left;gap:18px;padding:22px 18px !important;background:#f8fafc !important;border:1.5px solid #dfe6f0 !important;border-radius:14px !important;color:#203651 !important;box-shadow:none !important;transition:background .18s,transform .18s,border-color .18s}
.te-mode-option:hover {transform:translateY(-2px);background:#eef4fb !important;border-color:#afc8e5 !important}
.te-mode-option-digital {background:#eef5ff !important;border-color:#b5ceee !important}
.te-mode-option-digital:hover {background:#dfedff !important;border-color:#7da7d8 !important}
.te-mode-icon {display:flex;align-items:center;justify-content:center;width:57px;height:57px;border-radius:14px;font-size:30px;flex-shrink:0}
.te-mode-icon-print {background:#e6ebf2;color:#375173}
.te-mode-icon-digital {background:#d4e6fa;color:#245c9d}
.te-mode-copy {display:flex;flex-direction:column;gap:6px;flex:1}
.te-mode-copy b {font-size:19px;color:#173b65}
.te-mode-copy small {font-size:12px;color:#718096;line-height:1.5;font-weight:500}
.te-mode-chevron {font-size:21px;color:#7f9ebb}
.te-mode-footer {text-align:center;margin-top:19px;padding-top:17px;border-top:1px solid #e8eef6;color:#8190a4;font-size:11px}
.te-main-card {background:#fff;border:1px solid #dee7f2;border-radius:17px;overflow:hidden;box-shadow:0 9px 28px #19385a0b;color:#243852}
.te-hero {padding:27px 31px;background:linear-gradient(115deg,#182f53 4%,#275584 95%);color:white}
.te-eyebrow {color:#b0d4fa;margin-bottom:9px}
.te-heading-row {display:flex;align-items:center;justify-content:space-between;gap:15px}
.te-heading-row h2 {color:#fff;margin:0 0 6px;font-size:25px;letter-spacing:-.6px}
.te-heading-row p {color:#d9e9f8;font-size:13px;margin:0;line-height:1.6}
.te-stage {padding:26px 31px 30px}
.te-stage-title {display:flex;gap:14px;align-items:center;margin-bottom:19px;flex-wrap:wrap}
.te-step {font-weight:800;color:#275f97;border:1px solid #c6daed;background:#ecf5fe;border-radius:11px;padding:9px 10px}
.te-stage-title div {flex:1}
.te-stage-title h3 {font-size:18px;color:#1e3c61;margin:0 0 3px}
.te-stage-title p {font-size:12px;color:#7c8b9e;margin:0}
.te-btn {border-radius:9px !important;padding:9px 14px !important;font-weight:750 !important;white-space:nowrap !important;font-size:12px !important;cursor:pointer}
.te-btn-muted {background:#f1f5fa !important;border:1px solid #d9e1eb !important;color:#37526e !important}
.te-btn-ghost {background:#ffffff19 !important;border:1px solid #ffffff73 !important;color:#fff !important}
.te-btn-primary {background:#245f9d !important;border:1px solid #245f9d !important;color:white !important}
.te-btn:disabled {opacity:.55;cursor:default}
.te-search {border:1px solid #d6e2ed;border-radius:10px;display:flex;align-items:center;gap:9px;padding:2px 13px;margin-bottom:14px;background:#fff}
.te-search span {font-size:22px;color:#6d8fae}
.te-search input {width:100%;border:0 !important;outline:none !important;box-shadow:none !important;padding:12px 2px !important;background:transparent !important;font-size:13px}
.te-table-wrap {overflow-x:auto;border:1px solid #dee7f0;border-radius:10px}
.te-data-table {width:100%;border-collapse:collapse;font-size:12px;min-width:610px}
.te-data-table th {background:#eaf1f8;color:#34516f;font-weight:800;text-align:center;padding:12px 10px;border-bottom:1px solid #d7e2ee;white-space:nowrap}
.te-data-table td {border-top:1px solid #ecf0f5;padding:11px 9px;text-align:center;color:#41536b;vertical-align:middle;line-height:1.5}
.te-data-table tbody tr:nth-child(even){background:#fafcff}
.te-data-table tbody tr.te-my-row{background:#edf6ff}
.te-name {font-weight:800;color:#233d62 !important}
.te-empty {padding:30px;text-align:center;color:#71839a}
.te-note {margin:12px 0 0;color:#8b98a9;font-size:11px;line-height:1.7}
.te-assignment-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:14px}
.te-assignment {display:flex;flex-direction:column;gap:11px;padding:20px;border:1px solid #d8e4ef;border-radius:13px;background:#fbfdff}
.te-assignment-kicker {font-size:11px;font-weight:800;color:#5b81ac}
.te-assignment h4 {margin:0;font-size:16px;color:#254265;line-height:1.5}
.te-assignment .te-sub {font-size:11px;color:#7689a0}
.te-assignment .te-action {margin-top:auto;align-self:flex-end}
.te-badge {display:inline-block;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800;background:#eaf0f5;color:#64809a}
.te-badge-done {background:#ddf7e9;color:#16835a}
.te-journal-facts {display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin-bottom:20px}
.te-fact {background:#f6f9fc;border:1px solid #e7edf4;padding:12px 15px;border-radius:10px}
.te-fact small {display:block;color:#8391a4;margin-bottom:5px;font-size:11px}
.te-fact strong {font-size:12px;color:#244464;font-weight:750;overflow-wrap:anywhere}
.te-journal-content {margin-bottom:21px;border:1px solid #e1e9f3;border-radius:10px;padding:18px;background:#fcfdff}
.te-journal-content h4,.te-attendee-title h4 {color:#294969;font-size:14px;margin:0 0 8px}
.te-journal-content div {color:#40546b;font-size:12px;white-space:pre-wrap;line-height:1.9}
.te-attendee-title {display:flex;justify-content:space-between;align-items:center;gap:8px;margin:8px 0}
.te-attendee-title p {font-size:11px;color:#8190a1;margin:0}
.te-sign-preview {width:116px;height:42px;object-fit:contain;background:#fff;border:1px solid #e3e8ef;border-radius:6px}
.te-sign-status {display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap}
.te-sign-status small {display:block;line-height:1.35;color:#7f90a2;font-size:10px}
.te-pad-dialog {width:min(780px,100%)}
.te-sign-canvas-wrap {border:2px dashed #b8cce0;border-radius:12px;position:relative;overflow:hidden;background:#fff;margin:5px 0 14px}
#teSignCanvas {display:block;width:100%;height:235px;touch-action:none;cursor:crosshair;background:#fff}
.te-sign-canvas-wrap>span {position:absolute;bottom:8px;right:11px;color:#b2c1cf;pointer-events:none;font-size:11px}
.te-pad-actions {display:flex;justify-content:space-between;align-items:center;gap:10px}
.te-pad-right {display:flex;gap:8px}
.te-pad-dialog .te-note {margin-top:17px}
@media(max-width:720px) {.te-modal-backdrop {padding:12px}.te-mode-dialog,.te-pad-dialog {padding:25px 19px;border-radius:14px}.te-mode-dialog h2 {font-size:21px}.te-mode-option{gap:12px;padding:14px 12px !important}.te-mode-icon {width:48px;height:48px;font-size:25px}.te-mode-copy b {font-size:16px}.te-mode-copy small {font-size:11px}.te-stage{padding:18px 14px}.te-hero{padding:24px 17px}.te-heading-row h2{font-size:20px}.te-stage-title{align-items:flex-start}.te-stage-title .te-btn {margin-left:auto}.te-attendee-title {align-items:flex-start;flex-direction:column}#teSignCanvas{height:245px}}

/* 396차: education-specific downloads, kept inside the electronic portal. */
.te-hero-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.te-btn-download{color:#173b64 !important;background:#f4f8fe !important;border:1px solid #dce9f6 !important}
.te-btn-download:hover{background:#e2effb !important}
.te-assignment .te-unprepared{background:#fff0d7;color:#8b5814}
@media(max-width:720px){.te-heading-row{align-items:flex-start;flex-direction:column}.te-hero-actions{justify-content:flex-start}}

/* 413: isolated attendee management layout. Signing and existing portal styles unchanged. */
.te-roster-dialog{position:relative;background:#fff;width:min(1110px,98vw);max-height:92vh;overflow:auto;border-radius:17px;box-shadow:0 30px 90px #0b254766;color:#263c58}
.te-roster-header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:24px 27px;border-bottom:1px solid #dce7f2;background:#f8fbff}
.te-roster-header h2{margin:7px 0 3px;font-size:20px;color:#193f69}
.te-roster-header p{margin:0;color:#718298;font-size:12px}
.te-roster-columns{display:grid;grid-template-columns:minmax(210px,.72fr) minmax(410px,1.8fr);gap:0}
.te-roster-list{max-height:70vh;overflow:auto;padding:14px;background:#f5f9fe;border-right:1px solid #dae5f0}
.te-roster-list button{width:100%;display:block;text-align:left;margin-bottom:7px;padding:12px 11px !important;border:1px solid #dce6f1 !important;border-radius:10px !important;background:white !important;color:#254365 !important;font-size:12px;font-weight:700}
.te-roster-list button.active{background:#e1efff !important;border-color:#83b4e6 !important}
.te-roster-list small{display:block;color:#6e829b;font-size:11px;margin-top:4px;font-weight:500}
.te-roster-editor{padding:22px;min-width:0}
.te-roster-editor h3{font-size:16px;color:#244f7a;margin:0 0 7px}
.te-roster-editor .te-note{margin:7px 0 12px}
.te-roster-actions{display:flex;justify-content:flex-end;margin:12px 0 18px}
.te-roster-add{border-top:1px solid #dae6f2;padding-top:16px}
.te-roster-add h4{color:#204b77;margin:0 0 6px}
.te-roster-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:14px 0}
.te-roster-fields label{display:flex;flex-direction:column;gap:6px;font-size:11px;color:#50677f;font-weight:750}
.te-roster-fields input{min-width:0;width:100%;box-sizing:border-box;border:1px solid #cad8e6;border-radius:7px;padding:9px 8px;font-size:13px}
.te-roster-editor .te-data-table{min-width:420px}
@media(max-width:790px){.te-roster-columns{grid-template-columns:1fr}.te-roster-list{max-height:200px;border-right:0;border-bottom:1px solid #dae5f0}.te-roster-fields{grid-template-columns:1fr}.te-roster-editor{padding:15px}.te-roster-header{padding:18px}}

/* 415: a native modal dialog enters the browser top layer, so the
   confirmation cannot be hidden/clipped by the scrollable roster window. */
#teRosterDeleteConfirm:not([open]){display:none !important}
#teRosterDeleteConfirm.te-roster-confirm-dialog{position:fixed;inset:0;margin:auto;padding:0;border:0;border-radius:14px;background:transparent;width:min(430px,calc(100vw - 32px));max-width:none;max-height:calc(100vh - 32px);overflow:visible;box-shadow:0 18px 46px rgba(15,23,42,.38)}
#teRosterDeleteConfirm::backdrop{background:rgba(15,23,42,.42)}
#teRosterDeleteConfirm .te-roster-confirm-card{position:static;right:auto;bottom:auto;transform:none;width:100%;box-sizing:border-box}

/* 416: stand-alone, bottom-right notice positioned inside the attendee window. */
#teRosterSelectionNotice:not([open]){display:none !important}
#teRosterSelectionNotice.te-roster-selection-notice{position:fixed;inset:auto;margin:0;padding:16px 17px 13px;box-sizing:border-box;border:1px solid #c8d8eb;border-radius:11px;max-width:calc(100vw - 24px);background:#fff;box-shadow:0 12px 34px rgba(13,40,79,.3);color:#294260;font-size:13px;z-index:1}
#teRosterSelectionNotice::backdrop{background:rgba(13,34,65,.15)}
#teRosterSelectionNotice p{margin:0 0 12px;line-height:1.5;word-break:keep-all}
#teRosterSelectionNotice .te-roster-notice-actions{display:flex;justify-content:flex-end}

/* 441: desktop journal buttons belong at the far right, not in the flexible title column. */
#teJournalStage .te-stage-title > .te-journal-head-actions { flex:0 0 auto; margin-left:auto; justify-content:flex-end; }
/* 440: journal-only attendee search and personal signature navigation. */
.te-journal-head-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-left:auto; }
.te-journal-search440 { max-width:520px; margin:0 0 14px; }
.te-my-row.te-sign-highlight440 { outline:2px solid #3b82c4; outline-offset:-2px; background:#dceeff !important; }
.te-attendee-table tbody tr { scroll-margin-top:115px; }
@media(max-width:720px) { .te-journal-head-actions { width:100%; justify-content:flex-end; } }

/* 444: Mobile-only layout for the employee electronic signing portal.
   Existing desktop styling, row identifiers, events, and saved data stay intact. */
@media (max-width:720px) {
  /* The legacy top menu has a fixed 88px height even when its items wrap.
     Only while this electronic-signing page is active, give every menu row
     its natural height and remove the sticky overlay over form controls. */
  .app-layout:has(#trainingElectronic.active) > .side-nav {
    position:relative !important;
    top:auto !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    padding:4px 8px !important;
    background:linear-gradient(135deg,#14295f,#183d86) !important;
    flex-wrap:wrap !important;
    gap:0 !important;
  }
  .app-layout:has(#trainingElectronic.active) > .side-nav::before { display:none !important; }
  .app-layout:has(#trainingElectronic.active) > .side-nav .side-group-title {
    padding:0 9px !important;
    min-height:43px !important;
    font-size:12px !important;
  }
  .app-layout:has(#trainingElectronic.active) > .side-nav .side-menu:not(.collapsed) {
    top:100% !important;
    box-shadow:0 12px 24px rgba(15,23,42,.14) !important;
  }
  .app-layout:has(#trainingElectronic.active) > .app {padding:12px !important;}
  /* Keep the existing My-menu dropdown within narrow phone viewports. */
  body:has(#trainingElectronic.active) header .my-menu-dropdown {
    left:auto;right:0;
  }

  #trainingElectronic,
  #trainingElectronic .te-main-card,
  #trainingElectronic .te-stage { min-width:0; max-width:100%; }
  #trainingElectronic .te-main-card {border-radius:12px;}
  #trainingElectronic .te-stage {padding:17px 13px 20px;}
  #trainingElectronic .te-hero {padding:20px 14px;}
  #trainingElectronic .te-hero-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
    gap:8px;
  }
  #trainingElectronic .te-hero-actions .te-btn {
    min-width:0;
    min-height:44px;
    white-space:normal !important;
    line-height:1.35;
  }
  #trainingElectronic .te-stage-title {gap:9px;align-items:flex-start;}
  #trainingElectronic .te-stage-title > div:not(.te-journal-head-actions) {min-width:0;}
  #trainingElectronic .te-stage-title h3,
  #trainingElectronic .te-stage-title p {overflow-wrap:anywhere;}
  #teAssignmentStage .te-stage-title > #teBackToPeople {
    width:100%;min-height:44px;margin:4px 0 0;white-space:normal !important;
  }
  #trainingElectronic .te-assignment-grid {grid-template-columns:minmax(0,1fr);}
  #trainingElectronic .te-assignment {min-width:0;padding:15px;overflow-wrap:anywhere;}
  #trainingElectronic .te-assignment .te-action {width:100%;min-height:44px;align-self:stretch;}
  #trainingElectronic .te-journal-facts {grid-template-columns:repeat(2,minmax(0,1fr));}
  #trainingElectronic .te-fact {min-width:0;padding:11px;}
  #trainingElectronic .te-journal-content {padding:13px;overflow-wrap:anywhere;}
  #teJournalStage .te-stage-title > .te-journal-head-actions {
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;min-width:0;margin:4px 0 0;gap:8px;
  }
  #teJournalStage .te-journal-head-actions .te-btn {
    min-width:0;min-height:48px;padding:8px 7px !important;
    white-space:normal !important;line-height:1.35;
  }
  #trainingElectronic .te-search input {min-width:0;font-size:16px !important;}

  /* Display the existing employee and attendee rows as tap-friendly cards.
     Keep the original table markup, data-* attributes, and event delegation. */
  #tePersonStage .te-table-wrap,
  #teJournalStage .te-table-wrap {overflow:visible;border:0;border-radius:0;}
  #tePersonStage .te-data-table,
  #teJournalStage .te-attendee-table {display:block;min-width:0;width:100%;}
  #tePersonStage .te-data-table thead,
  #teJournalStage .te-attendee-table thead {display:none;}
  #tePersonRows,#teAttendeeRows {display:grid;grid-template-columns:minmax(0,1fr);gap:10px;}
  #tePersonRows > tr,#teAttendeeRows > tr {
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px 12px;width:100%;min-width:0;padding:13px;
    border:1px solid #dce6f1;border-radius:12px;background:#fff;
  }
  #tePersonRows > tr:nth-child(even),
  #teAttendeeRows > tr:nth-child(even) {background:#fbfdff;}
  #teAttendeeRows > tr.te-my-row {background:#edf6ff; border-color:#abcde9;}
  #tePersonRows > tr > td,#teAttendeeRows > tr > td {
    display:flex;flex-direction:column;align-items:flex-start;justify-content:center;
    gap:3px;min-width:0;padding:0;border:0;text-align:left;
    font-size:12px;white-space:normal;overflow-wrap:anywhere;background:transparent !important;
  }
  #tePersonRows > tr > td::before,
  #teAttendeeRows > tr > td::before {
    display:block;font-size:10px;font-weight:750;line-height:1.2;color:#71849a;
  }
  #tePersonRows > tr > td:nth-child(1),
  #teAttendeeRows > tr > td:nth-child(1) {
    grid-column:2;grid-row:1;align-items:flex-end;font-size:11px;color:#71849a;
  }
  #tePersonRows > tr > td:nth-child(1)::before,
  #teAttendeeRows > tr > td:nth-child(1)::before {content:'번호';}
  #tePersonRows > tr > td:nth-child(5) {
    grid-column:1;grid-row:1;font-size:16px;color:#233d62;font-weight:850;
  }
  #tePersonRows > tr > td:nth-child(5)::before {content:'성명';}
  #tePersonRows > tr > td:nth-child(2) {grid-column:1;grid-row:2;}
  #tePersonRows > tr > td:nth-child(2)::before {content:'소속 사업장';}
  #tePersonRows > tr > td:nth-child(3) {grid-column:2;grid-row:2;}
  #tePersonRows > tr > td:nth-child(3)::before {content:'소속 부서';}
  #tePersonRows > tr > td:nth-child(4) {grid-column:1;grid-row:3;}
  #tePersonRows > tr > td:nth-child(4)::before {content:'직급';}
  #tePersonRows > tr > td:nth-child(6) {grid-column:2;grid-row:3;}
  #tePersonRows > tr > td:nth-child(6)::before {content:'선택';}
  #tePersonRows > tr > td:nth-child(6) .te-btn {
    width:100%;min-height:44px;white-space:normal !important;
  }

  #teAttendeeRows > tr > td:nth-child(4) {
    grid-column:1;grid-row:1;font-size:16px;color:#233d62;font-weight:850;
  }
  #teAttendeeRows > tr > td:nth-child(4)::before {content:'성명';}
  #teAttendeeRows > tr > td:nth-child(2) {grid-column:1;grid-row:2;}
  #teAttendeeRows > tr > td:nth-child(2)::before {content:'소속';}
  #teAttendeeRows > tr > td:nth-child(3) {grid-column:2;grid-row:2;}
  #teAttendeeRows > tr > td:nth-child(3)::before {content:'직급';}
  #teAttendeeRows > tr > td:nth-child(5) {grid-column:1/-1;grid-row:3;}
  #teAttendeeRows > tr > td:nth-child(5)::before {content:'서명';}
  #teAttendeeRows > tr > td:nth-child(6) {grid-column:1/-1;grid-row:4;}
  #teAttendeeRows > tr > td:nth-child(6)::before {content:'비고';}
  #teAttendeeRows .te-sign-status {justify-content:flex-start;}
  #teAttendeeRows > tr > td:nth-child(5) > div[style] {
    width:100%;display:flex;gap:8px;flex-wrap:wrap;margin-top:6px;
  }
  #teAttendeeRows [data-te-sign],#teAttendeeRows [data-te-delete-sign] {
    flex:1 1 118px;min-height:44px;white-space:normal !important;
  }
  #tePersonRows > tr > td[colspan],#teAttendeeRows > tr > td[colspan] {
    grid-column:1/-1 !important;grid-row:auto !important;
    display:block;text-align:center;padding:10px 0;
  }
  #tePersonRows > tr > td[colspan]::before,
  #teAttendeeRows > tr > td[colspan]::before {display:none;}

  /* Short viewports: keep the save controls inside scrollable signing modal. */
  #trainingESignModeBackdrop,#trainingESignPadBackdrop {
    padding:10px;align-items:safe center;
  }
  .te-mode-dialog,.te-pad-dialog {
    width:100%;max-height:calc(100dvh - 20px);
    overflow-y:auto;overscroll-behavior:contain;padding:19px 15px;
  }
  #teSignCanvas {height:180px;}
  .te-pad-actions {display:flex;flex-wrap:wrap;gap:8px;}
  .te-pad-actions > .te-btn {flex:1 1 100%;min-height:44px;}
  .te-pad-actions .te-pad-right {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:8px;width:100%;}
  .te-pad-actions .te-pad-right .te-btn {
    min-width:0;min-height:46px;white-space:normal !important;
  }
}
