/* ============================================================
   모든 화면 공통: 왼쪽 메뉴, 화면 전환, 시계
   (일반 화면 style.css 와 사업장 정보 관리 admin_extra.css 둘 다 이 파일을 먼저 씀)
   ============================================================ */
/* 글꼴: 자주 쓰는 한글 2,350자 + 영문·숫자만 담은 가벼운 파일 (원본 1.5MB → 0.2MB)
   없는 글자는 맑은 고딕으로 표시. PDF 보고서는 원본 .otf 를 그대로 사용 */
@font-face { font-family: Pretendard; font-weight: 400; font-display: swap; src: url("../fonts/Pretendard-Regular.1d5b95274285.woff2") format("woff2"); }
@font-face { font-family: Pretendard; font-weight: 700; font-display: swap; src: url("../fonts/Pretendard-Bold.86b5cf6adea5.woff2") format("woff2"); }

/* 메뉴를 눌러 다른 화면으로 갈 때 하얗게 깜빡이지 않고 부드럽게 바뀜 (Edge·Chrome)
   왼쪽 메뉴와 위 제목줄은 그대로 있고 본문만 바뀜 */
@view-transition { navigation: auto; }
.ems-side { view-transition-name: ems-side; }
.ems-top { view-transition-name: ems-top; }
::view-transition-group(*) { animation-duration: .12s; }
::view-transition-old(ems-side), ::view-transition-new(ems-side) { animation: none; mix-blend-mode: normal; }

/* 왼쪽 메뉴 */
.ems-side, .ems-side * { box-sizing: border-box; }
.ems-side { width: 216px; flex-shrink: 0; color: #fff; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0f1f35 0%, #12263f 55%, #15304f 100%);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.06);
  font-family: Pretendard, "Malgun Gothic", sans-serif; font-size: 14px; }
.ems-logo { display: block; padding: 22px 24px 20px; line-height: 0; }
.ems-logo img { width: 150px; height: auto; }
.ems-brand-text { display: block; padding: 26px 20px 24px; color: #fff; text-decoration: none; font-size: 16.5px; font-weight: 700;
  letter-spacing: -.3px; white-space: nowrap; }
.ems-brand-text em { font-style: normal; color: #5fa8ff; letter-spacing: .5px; }
.ems-side nav { padding: 6px 10px; display: grid; gap: 2px; }
.ems-side nav > a { position: relative; display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: 8px;
  color: #b8c6d9; text-decoration: none; transition: background .15s, color .15s; }
.ems-side nav > a svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.ems-side nav > a:hover { background: rgba(255,255,255,.06); color: #fff; }
.ems-side nav > a.on { background: linear-gradient(90deg, rgba(59,130,246,.28), rgba(59,130,246,.08)); color: #fff; font-weight: 700; }
.ems-side nav > a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #5fa8ff; }
.ems-side nav > a.on svg { opacity: 1; color: #8cc2ff; }
.ems-nav-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ems-side.site-mode nav > a:first-child .ems-nav-t { font-weight: 700; color: #fff; }
.ems-sub { padding: 2px 0 8px 18px; display: grid; gap: 1px; }
.ems-side .ems-grp { display: block; width: 100%; text-align: left; padding: 8px 14px; font: inherit; font-size: 12px; color: #8ea0b8;
  background: none; border: 0; cursor: pointer; position: relative; border-radius: 6px; letter-spacing: .2px; }
.ems-side .ems-grp::after { content: ""; position: absolute; right: 14px; top: 50%; width: 5px; height: 5px; margin-top: -4px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.ems-side .ems-grp.open::after { transform: rotate(225deg); margin-top: -1px; }
.ems-side .ems-grp:hover { color: #fff; }
.ems-side .ems-grp-items { display: grid; gap: 1px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.08); margin-left: 14px; }
.ems-side .ems-grp-items a, .ems-side a.ems-grp-link { display: block; padding: 7px 12px; font-size: 13px; color: #b8c6d9;
  text-decoration: none; border-radius: 6px; }
.ems-side .ems-grp-items a:hover, .ems-side a.ems-grp-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.ems-side .ems-grp-items a.on, .ems-side a.ems-grp-link.on { color: #fff; font-weight: 700; background: rgba(59,130,246,.3); }
.ems-side a.ems-grp-link { padding-left: 14px; color: #8ea0b8; font-size: 12px; }
.ems-side-foot { margin-top: auto; padding: 18px 24px; font-size: 12px; color: #6f85a3; border-top: 1px solid rgba(255,255,255,.06); }

/* 알람 개수 배지 (미확인 있으면 빨간색 깜빡임) */
.nbadge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: auto; border-radius: 9px; background: #d97706;
  color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }
.nbadge.new { background: #dc2626; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .nbadge.new { animation: none; } }

/* 시계: 숫자 폭을 고정해서 초가 바뀌어도 글자가 움직이지 않게 */
.ems-clock { font-variant-numeric: tabular-nums; display: inline-block; min-width: 10.5em; text-align: right; }

@media (max-width: 760px) {
  .ems-side { width: auto; }
  .ems-side nav { display: flex; overflow-x: auto; }
  .ems-side nav > a { white-space: nowrap; padding: 9px 12px; font-size: 13px; }
  .ems-side nav > a.on::before { display: none; }
  .ems-sub, .ems-side-foot { display: none; }
  .ems-logo { padding: 12px 14px 4px; }
  .ems-brand-text { padding: 12px 14px 4px; font-size: 15px; }
  .ems-logo img { width: 110px; }
  .ems-clock { display: none; }
}

/* ── 확인창 (로그아웃·삭제 등, static/js/common.js 의 emsConfirm) ── */
.ems-confirm { border: 0; border-radius: 12px; padding: 24px 26px 20px; width: min(380px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(18,38,63,.3); font-family: Pretendard, "Malgun Gothic", sans-serif; color: #1b3048; }
.ems-confirm::backdrop { background: rgba(18,38,63,.45); }
.ems-confirm p { margin: 0; font-size: 16px; font-weight: 700; }
.ems-confirm small { display: block; margin-top: 6px; color: #708197; font-size: 13px; word-break: break-all; }
.ems-confirm .cf-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.ems-confirm button { min-width: 84px; height: 38px; border-radius: 6px; font: inherit; font-weight: 700; cursor: pointer; }
.ems-confirm .cf-no { background: #fff; border: 1px solid #dce4ee; color: #1b3048; }
.ems-confirm .cf-ok { background: #245fd3; border: 1px solid #245fd3; color: #fff; }
.ems-confirm .cf-ok.danger { background: #c0392b; border-color: #c0392b; }

/* ── 위쪽 알림 (저장했습니다 등) ── */
.ems-msgs { list-style: none; margin: 14px 28px 0; padding: 0; transition: opacity .6s; }
.ems-msgs li { padding: 10px 16px; border-radius: 6px; font-size: 13px; background: #e7f6ec; border: 1px solid #bfe5cb; color: #1b3048; }
.ems-msgs li.warning, .ems-msgs li.error { background: #fff6e0; border-color: #f1dfae; }
.ems-msgs.fade { opacity: 0; }

/* 날씨 한 줄 (core/_weather.html) */
.wx { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; padding: 5px 12px;
      background: #f2f7fd; border: 1px solid #dbe7f5; border-radius: 16px; font-size: 13px; color: #1e293b; }
.wx-i { font-size: 16px; line-height: 1; }
.wx-t { font-size: 15px; font-variant-numeric: tabular-nums; }
.wx span { color: #475569; font-variant-numeric: tabular-nums; }
.wx .wx-ts { color: #708197; font-size: 12px; }
.mon-head + .wx { margin: 0 0 12px; }
@media (max-width: 760px) { .wx { display: flex; border-radius: 10px; } }
.wx-c { font-variant-numeric: tabular-nums; }
/* 위쪽 시계 옆 날씨 (includes/hdr_weather.html) */
.hwx { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 14px; background: #f2f7fd;
       border: 1px solid #dbe7f5; color: #1e293b; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; cursor: default; }
.hwx b { font-size: 14px; }
.hwx-n { font-style: normal; color: #475569; font-weight: 700; max-width: 12em; overflow: hidden; text-overflow: ellipsis; }
.hwx-i { font-size: 15px; line-height: 1; }
.hwx-x { color: #64748b; }
@media (max-width: 1280px) { .hwx-x { display: none; } }
@media (max-width: 760px) { .hwx-n { display: none; } .hwx { padding: 2px 8px; } }

/* ── 왼쪽 메뉴: 대메뉴(nav-h 제목 / nav-1 단독 항목) → 중메뉴(nav-2) ── */
.ems-side nav { overflow-y: auto; overflow-x: hidden; }
@media (max-width: 900px) { .ems-side nav { overflow-x: auto; } }
.ems-side .nav-grp { margin: 6px 0 2px; }
.ems-side .nav-h { display: flex; align-items: center; gap: 11px; padding: 8px 14px 4px; color: #e6edf6; font-size: 14px; font-weight: 600; }
.ems-side .nav-h svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.ems-side a.nav-2 { position: relative; display: flex; align-items: center; justify-content: space-between; margin-left: 23px;
  padding: 7px 12px; border-left: 1px solid rgba(255,255,255,.1); color: #a9b9ce; text-decoration: none; font-size: 13.5px; }
.ems-side a.nav-2:hover { color: #fff; background: rgba(255,255,255,.05); }
.ems-side a.nav-2.on { color: #fff; font-weight: 700; background: linear-gradient(90deg, rgba(59,130,246,.3), rgba(59,130,246,.06));
  border-left: 3px solid #5fa8ff; padding-left: 10px; border-radius: 0 6px 6px 0; }
.ems-side a.nav-2 .nbadge { margin-left: 8px; }
@media (max-width: 760px) {
  .ems-side .nav-grp { display: contents; }
  .ems-side .nav-h { display: none; }
  .ems-side a.nav-2 { margin-left: 0; border-left: 0; white-space: nowrap; padding: 9px 12px; font-size: 13px; border-radius: 8px; }
  .ems-side a.nav-2.on { border-left: 0; padding-left: 12px; border-radius: 8px; }
}

/* ── 팝업 창 (모든 화면 공통) ── */
.ems-dlg { border: 0; border-radius: 12px; padding: 0; box-shadow: 0 20px 60px rgba(18,38,63,.3); width: min(520px, calc(100vw - 32px));
  color: #1e293b; font-family: Pretendard, "Malgun Gothic", sans-serif; }
.ems-dlg.wide { width: min(860px, calc(100vw - 32px)); }
.ems-dlg::backdrop { background: rgba(18,38,63,.45); }
.ems-dlg .dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid #e5eaf1; }
.ems-dlg .dlg-head b { font-size: 16px; }
.ems-dlg .dlg-x { border: 0; background: none; font-size: 24px; line-height: 1; color: #708197; cursor: pointer; padding: 0 4px; }
.ems-dlg .dlg-body { padding: 18px 22px; display: grid; gap: 12px; max-height: calc(100vh - 220px); overflow-y: auto; }
.ems-dlg .dlg-body label.fld { display: grid; gap: 5px; font-size: 13px; color: #475569; font-weight: 600; }
.ems-dlg .dlg-body label.fld small { font-weight: 400; color: #708197; }
.ems-dlg .dlg-body input:not([type=checkbox]):not([type=radio]), .ems-dlg .dlg-body select, .ems-dlg .dlg-body textarea {
  height: 38px; padding: 0 10px; border: 1px solid #d6dee8; border-radius: 6px; font: inherit; font-size: 14px; color: #1e293b; background: #fff; }
.ems-dlg .dlg-body textarea { height: 80px; padding: 8px 10px; }
.ems-dlg .dlg-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ems-dlg .dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid #e5eaf1; background: #f8fafc;
  border-radius: 0 0 12px 12px; }
.ems-dlg .dlg-foot .left { margin-right: auto; }
.ems-dlg .dlg-err { color: #b91c1c; background: #fdecec; border-radius: 6px; padding: 8px 12px; font-size: 13px; }
.ems-dlg .btn, .ems-dlg .btn-line, .ems-dlg .btn-del { height: 38px; padding: 0 18px; border-radius: 6px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.ems-dlg .btn { background: #245fd3; color: #fff; border: 1px solid #245fd3; }
.ems-dlg .btn-line { background: #fff; color: #334155; border: 1px solid #cbd5e1; }
.ems-dlg .btn-del { background: #dc2626; color: #fff; border: 1px solid #dc2626; }
@media (max-width: 760px) { .ems-dlg .dlg-2 { grid-template-columns: 1fr; } }

/* ── 날짜·시각 고르기 ── */
.dp-btn { height: 36px; padding: 0 12px 0 34px; border: 1px solid #d6dee8; border-radius: 6px; background: #fff
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23708197' stroke-width='1.8'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E") 10px 50% / 16px no-repeat;
  font: inherit; font-size: 14px; color: #1e293b; cursor: pointer; text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dp-btn:hover { border-color: #245fd3; }
.dp-dlg { width: min(340px, calc(100vw - 32px)); }
.dp-dlg .dp-cal, .dp-dlg .dp-time, .dp-dlg .dp-sel { padding: 0 18px; }
.dp-dlg .dp-cal { padding-top: 12px; }
.dp-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dp-nav button { border: 1px solid #d6dee8; background: #fff; border-radius: 6px; width: 32px; height: 30px; font-size: 18px; cursor: pointer; }
.dp-wd, .dp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-wd span { font-size: 12px; color: #708197; padding: 4px 0; }
.dp-wd span:first-child { color: #dc2626; }
.dp-days button { height: 34px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 14px; cursor: pointer; font-variant-numeric: tabular-nums; }
.dp-days button:hover { background: #eef4fe; }
.dp-days button.sun { color: #dc2626; }
.dp-days button.today { box-shadow: inset 0 0 0 1px #245fd3; }
.dp-days button.on { background: #245fd3; color: #fff; font-weight: 700; }
.dp-days button:disabled { color: #cbd5e1; cursor: default; background: none; }
.dp-today { margin: 6px 0 0; border: 0; background: none; color: #245fd3; font: inherit; font-size: 13px; cursor: pointer; padding: 4px 0; }
.dp-time { display: flex; gap: 14px; padding-top: 10px !important; }
.dp-time label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; }
.dp-time select { height: 34px; padding: 0 8px; border: 1px solid #d6dee8; border-radius: 6px; font: inherit; }
.dp-sel { padding: 10px 18px 14px !important; font-size: 13px; color: #245fd3; font-weight: 700; }
.ems-dlg, .ems-dlg * { box-sizing: border-box; }
.ems-dlg .dlg-body input:not([type=checkbox]):not([type=radio]), .ems-dlg .dlg-body select, .ems-dlg .dlg-body textarea { width: 100%; min-width: 0; }
.ems-dlg .dlg-2 > * { min-width: 0; }
