/* 솔루션 본사 마스터 포털 전용 스타일 (2026-11-20, 2026-11-21 관리자 skin4 상단·좌측 메뉴·위치 표시와 같은 모양으로 수정).
   관리자 skin4(stig.css·ace-reference.css)의 색·크기·간격 값을 마스터 전용 자산으로 다시 작성했다. 형제 스킨 파일을 불러오지 않는다. */
:root {
  --mst-ink: #12294a;
  --mst-muted: #526988;
  --mst-blue: #105cb7;
  --mst-blue-strong: #0d4d9a;
  --mst-ground: #f0f6fd;
  --mst-panel: #ffffff;
  --mst-wash: #e7f1ff;
  --mst-line: #dbe7f5;
  --mst-danger: #b42332;
  --mst-ok: #1d6b43;
  --mst-rail: 242px;
  --mst-top-h: 66px;
  --mst-gutter: clamp(18px, 2.65vw, 44px);
  --mst-font: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.mst { margin: 0; background: var(--mst-ground); color: var(--mst-ink); font: 13px/1.5 var(--mst-font); }
.mst a { color: var(--mst-blue); }
.mst button, .mst input, .mst select, .mst textarea { font: inherit; color: inherit; }
.mst :is(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--mst-blue); outline-offset: 2px; }
.mst-skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 6px 10px; z-index: 80; }
.mst-skip:focus { left: 8px; }
.mst-icon { display: block; width: 20px; height: 20px; flex: none; }

/* 상단: skin4 운영 콘솔 머리 */
.mst-top { position: fixed; inset: 0 0 auto 0; height: var(--mst-top-h); display: flex; align-items: center; gap: 14px; padding: 0 var(--mst-gutter); color: #fff; z-index: 40;
  background: linear-gradient(104deg, #123fa0 0%, #1266cd 54%, #337bd0 100%); box-shadow: 0 4px 16px #143b7926; }
.mst-brand { display: flex; align-items: center; gap: 10px; color: #fff !important; text-decoration: none; white-space: nowrap; }
.mst-brand .mst-icon { width: 32px; height: 32px; color: #d3ebff; }
.mst-brand strong { margin: 0; font-size: 23px; letter-spacing: .075em; line-height: 1; }
.mst-brand-caption { margin-left: 3px; padding-left: 13px; border-left: 1px solid #ffffff5e; color: #e5f1ff; font-size: 13px; font-weight: 400; }
.mst-account { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.mst-account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.mst-account-name small { color: #dcebff; }
.mst-top button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 10px; border: 1px solid #ffffff57; border-radius: 10px; background: #ffffff12; color: #fff; cursor: pointer; }
.mst-top button:hover { background: #ffffff2b; }
.mst-top button .mst-icon { width: 18px; height: 18px; }
.mst-menu-toggle { display: none !important; width: 38px; justify-content: center; padding: 0 !important; }

/* 왼쪽: skin4 펼침 메뉴 */
.mst-side { position: fixed; top: var(--mst-top-h); bottom: 0; left: 0; width: var(--mst-rail); display: flex; flex-direction: column; overflow-y: auto;
  background: #fbfdff; border-right: 1px solid var(--mst-line); z-index: 30; }
.mst-side-close { display: none; }
.mst-nav { flex: 1; padding: 14px 10px 18px; }
.mst-nav > a, .mst-nav summary { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 7px 10px; border-radius: 8px; color: #254368; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; }
.mst-nav > a { margin-bottom: 5px; }
.mst-nav summary { list-style: none; }
.mst-nav summary::-webkit-details-marker { display: none; }
.mst-nav summary::after { content: '›'; margin-left: auto; color: #52769e; font-size: 19px; line-height: 1; transition: transform .15s ease; }
.mst-nav details[open] > summary::after { transform: rotate(90deg); }
.mst-nav :is(a, summary) > .mst-icon { width: 18px; height: 18px; color: var(--mst-blue); }
.mst-nav details { margin: 2px 0; }
.mst-nav details[open] { background: #f1f6fc; border-radius: 8px; padding-bottom: 4px; }
.mst-nav details[open] > summary, .mst-nav :is(a, summary):hover { background: #e6f0ff; color: #124b92; }
.mst-nav details a { display: flex; align-items: center; gap: 10px; min-height: 34px; margin: 2px 4px; padding: 5px 8px 5px 25px; border-radius: 6px; color: #375373; font-size: 12px; text-decoration: none; }
.mst-nav details a::before { content: ''; width: 6px; height: 6px; border: 1px solid #84a6ca; border-radius: 50%; flex: none; }
.mst-nav a[aria-current=page] { color: #104d95; background: #dbeaff; font-weight: 700; }
.mst-nav details a[aria-current=page]::before { background: var(--mst-blue); border-color: var(--mst-blue); }
.mst-backdrop { display: none; }

/* 본문 · 위치 표시 */
.mst-main { margin-left: var(--mst-rail); padding: var(--mst-top-h) var(--mst-gutter) 40px; min-width: 0; }
.mst-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 20px 0 12px; }
.mst-title { margin: 0; color: var(--mst-ink); font-size: 25px; letter-spacing: -.035em; line-height: 1.2; font-weight: 700; }
.mst-crumb nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--mst-muted); font-size: 12px; }
.mst-crumb nav > :not(a)::before { content: "/"; color: #758da9; padding-right: 8px; }
.mst-crumb nav a { color: var(--mst-blue); }
.mst-crumb-action { margin-left: auto; display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: 6px; background: var(--mst-blue); color: #fff !important; text-decoration: none; font-weight: 600; }
.mst-crumb-action:hover { background: var(--mst-blue-strong); }
.mst-workspace { min-width: 0; }
.mst-panel { background: var(--mst-panel); border: 1px solid var(--mst-line); border-radius: 12px; margin: 0 0 16px; min-width: 0; box-shadow: 0 8px 28px #14396609; }
.mst-panel > h2 { margin: 0; padding: 14px 16px; font-size: 16px; border-bottom: 1px solid var(--mst-line); }
.mst-panel-body { padding: 16px; }
.mst-note { margin: 0 0 12px; color: var(--mst-muted); }
.mst-empty, .mst-loading { margin: 0; padding: 24px 16px; color: var(--mst-muted); background: var(--mst-panel); border: 1px solid var(--mst-line); border-radius: 12px; }
.mst-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 14px; }
.mst-toolbar .mst-spacer { margin-left: auto; }

/* 표 */
.mst-scroll { width: 100%; overflow-x: auto; }
.mst-table { width: 100%; border-collapse: collapse; }
.mst-table th, .mst-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #e3edf8; vertical-align: middle; white-space: nowrap; }
.mst-table th { background: var(--mst-wash); color: #214d81; font-weight: 700; font-size: 13px; }
.mst-table tbody tr:nth-child(even) td { background: #f8fbff; }
.mst-table td.mst-wrap { white-space: normal; min-width: 200px; }
.mst-num { text-align: right; font-variant-numeric: tabular-nums; }
.mst-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #e9eef5; color: #3d5470; font-size: 12px; }
.mst-badge[data-tone=ok] { background: #dff3e8; color: var(--mst-ok); }
.mst-badge[data-tone=warn] { background: #fff1d6; color: #7a4d00; }
.mst-badge[data-tone=bad] { background: #fde4e6; color: var(--mst-danger); }
.mst-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* 폼 */
.mst-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 18px; }
.mst-form .mst-full { grid-column: 1 / -1; }
.mst-stack { display: grid; gap: 14px; }
.mst-stack > label select { max-width: 520px; }
.mst-form label, .mst-toolbar label, .mst-stack > label { display: grid; gap: 5px; font-weight: 600; color: #26476e; font-size: 13px; }
.mst label.mst-check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.mst-form :is(input:not([type=checkbox]):not([type=radio]), select, textarea), .mst-toolbar select, .mst-stack > label select, .mst-table select { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid #b9cfe9; border-radius: 7px; background: #fff; }
.mst input[aria-invalid=true], .mst select[aria-invalid=true] { border-color: var(--mst-danger); }
.mst-field-error { color: var(--mst-danger); font-weight: 500; font-size: 12px; }
.mst-hint { color: var(--mst-muted); font-weight: 400; font-size: 12px; }
.mst-workspace button:not(.security-panel button) { min-height: 36px; padding: 6px 14px; border: 1px solid #b9cfe9; border-radius: 7px; background: #fff; color: #1d3f68; cursor: pointer; }
.mst-workspace button:not(.security-panel button):hover:not(:disabled) { background: var(--mst-wash); }
.mst button:disabled { opacity: .5; cursor: not-allowed; }
.mst .mst-primary { background: var(--mst-blue) !important; border-color: var(--mst-blue) !important; color: #fff !important; }
.mst .mst-primary:hover:not(:disabled) { background: var(--mst-blue-strong) !important; }
.mst .mst-danger { color: var(--mst-danger); border-color: #efb4ba; }
.mst-error { color: var(--mst-danger); margin: 0; }
.mst-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.mst-code { font-size: 15px; letter-spacing: .06em; word-break: break-all; background: var(--mst-wash); padding: 10px 12px; border-radius: 7px; }

/* 디자인 카드 */
.mst-skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mst-skin { padding: 14px; border: 1px solid var(--mst-line); border-radius: 10px; background: #fff; display: grid; gap: 8px; align-content: start; }
.mst-skin[data-current=true] { border-color: var(--mst-blue); background: #f2f8ff; }
.mst-skin h3 { margin: 0; font-size: 15px; }
.mst-skin p { margin: 0; color: var(--mst-muted); font-size: 13px; }

/* 알림·대화상자 */
.mst-toast { position: fixed; right: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 40px)); padding: 12px 16px; border-radius: 10px; background: #12294a; color: #fff; z-index: 90; }
.mst-toast[data-tone=error] { background: var(--mst-danger); }
.mst-dialog { width: min(640px, calc(100vw - 24px)); border: 0; border-radius: 12px; padding: 0; box-shadow: 0 18px 50px #0b264b40; color: var(--mst-ink); }
.mst-dialog::backdrop { background: #0b264b66; }
.mst-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--mst-line); }
.mst-dialog-head h2 { margin: 0; font-size: 17px; }
#mst-dialog-body { padding: 16px; }

/* 로그인 */
.mst-login-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.mst-login { width: min(420px, 100%); background: #fff; border: 1px solid var(--mst-line); border-radius: 12px; padding: 28px; }
.mst-login h1 { margin: 0 0 6px; font-size: 24px; color: var(--mst-blue-strong); }
.mst-login-lead { margin: 0 0 18px; color: var(--mst-muted); }
.mst-login form { display: grid; gap: 14px; }
.mst-login label { display: grid; gap: 5px; font-weight: 600; color: #26476e; }
.mst-login input { width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid #b9cfe9; border-radius: 7px; }
.mst-login button { min-height: 40px; border: 1px solid #b9cfe9; border-radius: 7px; background: #fff; cursor: pointer; }

@media (max-width: 900px) {
  :root { --mst-top-h: 57px; --mst-gutter: 12px; }
  .mst-menu-toggle { display: inline-flex !important; }
  .mst-side { transform: translateX(-100%); visibility: hidden; transition: transform .2s ease; z-index: 50; }
  .mst.menu-open .mst-side { transform: none; visibility: visible; }
  .mst.menu-open .mst-backdrop { display: block; position: fixed; inset: var(--mst-top-h) 0 0 0; border: 0; background: #0b264b55; z-index: 45; }
  .mst-side-close { display: block; align-self: flex-end; margin: 10px 10px 0; min-height: 34px; padding: 0 10px; border: 1px solid #bdd5f2; border-radius: 6px; background: #e5effe; color: #185498; }
  .mst-main { margin-left: 0; }
  .mst-brand-caption, .mst-account-name, .mst-logout span { display: none; }
  .mst-title { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { .mst-side, .mst-nav summary::after { transition: none; } }

/* Bounded preview thumbnails; external stylesheet required by CSP. */
.mst-skins { grid-template-columns:repeat(auto-fill,minmax(min(230px,100%),1fr)); }
.mst-skin { min-width:0; overflow:hidden; }
.mst-skin > a { display:block; min-width:0; width:100%; overflow:hidden; }
.mst-skin .mst-skin-preview { display:block; width:100%; max-width:100%; height:160px; object-fit:contain; background:#f3f6fa; border:1px solid #d8e3f1; box-sizing:border-box; }
.mst-skin h3,.mst-skin p { overflow-wrap:anywhere; }
