/* ==========================================================================
   FMS 디자인 기본값
   Bootstrap 위에 얹어서 색·글꼴·여백을 회사 기준으로 맞춥니다.
   ========================================================================== */

:root {
  /* 브랜드 */
  --fms-brand:        #1f5c8c;
  --fms-brand-dark:   #17466a;
  --fms-brand-tint:   #e9f1f7;
  --fms-brand-line:   #c5d9e8;

  /* 글자 */
  --fms-ink:          #14202b;
  --fms-ink-2:        #43525f;
  --fms-muted:        #6d7c8a;

  /* 면 */
  --fms-bg:           #f4f6f8;
  --fms-surface:      #ffffff;
  --fms-surface-2:    #eef2f6;
  --fms-line:         #dce3ea;
  --fms-line-soft:    #e8edf2;

  /* 의미색 */
  --fms-ok:           #1f7a52;
  --fms-ok-bg:        #e4f2ea;
  --fms-warn:         #8c6210;
  --fms-warn-bg:      #fbf0d8;
  --fms-danger:       #a93a30;
  --fms-danger-bg:    #f8e4e2;

  --fms-radius:       10px;
  --fms-radius-sm:    7px;

  --bs-body-font-family: "Pretendard Variable", Pretendard, -apple-system,
    "Segoe UI", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
}

/* ---------- 바탕 ---------- */

html { font-size: 16px; }

body {
  background: var(--fms-bg);
  color: var(--fms-ink);
  font-family: var(--bs-body-font-family);
  font-size: 0.95rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  padding-bottom: 3rem;
}

.container { max-width: 1120px; }

h1, h2, h3, h4 {
  color: var(--fms-ink);
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
}

/* 숫자가 세로로 줄맞춤되게 */
.font-monospace, td, .badge, input[type="number"], input[type="date"] {
  font-variant-numeric: tabular-nums;
}

a { color: var(--fms-brand); text-underline-offset: 2px; }
a:hover { color: var(--fms-brand-dark); }

/* ---------- 상단 메뉴 ---------- */

.navbar {
  background: var(--fms-surface) !important;
  border-bottom: 1px solid var(--fms-line) !important;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  margin-bottom: 1.75rem !important;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--fms-ink) !important;
}

.navbar-brand::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: url("/icons/icon-192.png") center / cover no-repeat;
  flex: 0 0 auto;
}

.navbar .nav-link {
  color: var(--fms-ink-2) !important;
  font-weight: 500;
  border-radius: var(--fms-radius-sm);
  padding: 0.4rem 0.75rem !important;
}

.navbar .nav-link:hover {
  color: var(--fms-brand) !important;
  background: var(--fms-brand-tint);
}

/* ---------- 페이지 제목 ---------- */

main h1 {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

/* 항목 묶음 제목 (기본 정보 / 하드웨어 설치 ...) */
main h2.text-uppercase {
  font-size: 0.72rem !important;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--fms-brand) !important;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--fms-line);
  margin-bottom: 1rem !important;
}

/* ---------- 카드 ---------- */

.card {
  background: var(--fms-surface);
  border: 1px solid var(--fms-line);
  border-radius: var(--fms-radius);
  box-shadow: 0 1px 2px rgba(20, 32, 43, 0.04);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

a.card:hover {
  border-color: var(--fms-brand-line);
  box-shadow: 0 3px 10px rgba(31, 92, 140, 0.10);
  transform: translateY(-1px);
}

.card-title { font-weight: 600; }

/* ---------- 표 ---------- */

.table {
  --bs-table-bg: var(--fms-surface);
  --bs-table-hover-bg: var(--fms-brand-tint);
  border-radius: var(--fms-radius);
  overflow: hidden;
  border: 1px solid var(--fms-line);
  margin-bottom: 0;
}

.table > thead th {
  background: var(--fms-surface-2) !important;
  color: var(--fms-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--fms-line) !important;
  padding: 0.7rem 0.9rem;
  white-space: nowrap;
}

.table > tbody td {
  padding: 0.75rem 0.9rem;
  border-color: var(--fms-line-soft);
  color: var(--fms-ink-2);
  vertical-align: middle;
}

.table > tbody tr:last-child td { border-bottom: 0; }

/* ---------- 입력 ---------- */

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fms-ink-2);
  margin-bottom: 0.3rem;
}

.form-control, .form-select {
  border-color: var(--fms-line);
  border-radius: var(--fms-radius-sm);
  padding: 0.5rem 0.7rem;
  color: var(--fms-ink);
  background-color: var(--fms-surface);
  transition: border-color .12s ease, box-shadow .12s ease;
}

.form-control::placeholder { color: #a8b3bd; }

.form-control:focus, .form-select:focus {
  border-color: var(--fms-brand);
  box-shadow: 0 0 0 3px rgba(31, 92, 140, 0.14);
}

.form-check-input:checked {
  background-color: var(--fms-brand);
  border-color: var(--fms-brand);
}

.form-check-input:focus {
  border-color: var(--fms-brand);
  box-shadow: 0 0 0 3px rgba(31, 92, 140, 0.14);
}

.form-text { color: var(--fms-muted); font-size: 0.8rem; }

textarea.form-control { line-height: 1.6; }

/* ---------- 버튼 ---------- */

.btn {
  border-radius: var(--fms-radius-sm);
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  letter-spacing: -0.01em;
}

.btn-primary {
  --bs-btn-bg: var(--fms-brand);
  --bs-btn-border-color: var(--fms-brand);
  --bs-btn-hover-bg: var(--fms-brand-dark);
  --bs-btn-hover-border-color: var(--fms-brand-dark);
  --bs-btn-active-bg: var(--fms-brand-dark);
  --bs-btn-active-border-color: var(--fms-brand-dark);
  --bs-btn-disabled-bg: var(--fms-brand);
  --bs-btn-disabled-border-color: var(--fms-brand);
}

.btn-outline-primary {
  --bs-btn-color: var(--fms-brand);
  --bs-btn-border-color: var(--fms-brand-line);
  --bs-btn-hover-bg: var(--fms-brand);
  --bs-btn-hover-border-color: var(--fms-brand);
  --bs-btn-active-bg: var(--fms-brand-dark);
  --bs-btn-active-border-color: var(--fms-brand-dark);
}

.btn-outline-secondary {
  --bs-btn-color: var(--fms-ink-2);
  --bs-btn-border-color: var(--fms-line);
  --bs-btn-hover-bg: var(--fms-surface-2);
  --bs-btn-hover-border-color: var(--fms-line);
  --bs-btn-hover-color: var(--fms-ink);
}

.btn:focus-visible { box-shadow: 0 0 0 3px rgba(31, 92, 140, 0.25); }

/* ---------- 배지 · 알림 ---------- */

.badge {
  font-weight: 600;
  letter-spacing: 0;
  padding: 0.3em 0.6em;
  border-radius: 5px;
}

.text-bg-success { background: var(--fms-ok-bg) !important; color: var(--fms-ok) !important; }
.text-bg-warning { background: var(--fms-warn-bg) !important; color: var(--fms-warn) !important; }
.text-bg-secondary { background: var(--fms-surface-2) !important; color: var(--fms-muted) !important; }

.alert {
  border-radius: var(--fms-radius);
  border-width: 1px;
  font-size: 0.9rem;
}

.alert-success {
  background: var(--fms-ok-bg);
  border-color: #bfdfcd;
  color: var(--fms-ok);
}

.text-muted { color: var(--fms-muted) !important; }

/* ---------- 오프라인 상태 띠 ---------- */

#fms-offline-bar {
  font-weight: 500;
  border-top: 1px solid rgba(0,0,0,.08);
  backdrop-filter: saturate(140%);
}

/* ---------- 모바일 ---------- */

@media (max-width: 767.98px) {
  body { font-size: 1rem; }

  /* 현장에서 손가락으로 누르기 편하게 */
  .form-control, .form-select {
    min-height: 46px;
    font-size: 1rem;
  }

  .btn { min-height: 44px; padding: 0.6rem 1rem; }
  .btn-sm { min-height: 36px; }

  .form-check-input { width: 1.25em; height: 1.25em; margin-top: 0.15em; }
  .form-check-label { padding-left: 0.15rem; }

  .card-body { padding: 0.9rem 1rem; }

  main h1 { font-size: 1.25rem; }
}

/* 리포트 폼의 저장 버튼을 화면 아래에 붙여둡니다 (항목이 많아 스크롤이 길어서) */
@media (max-width: 991.98px) {
  .fms-sticky-actions {
    position: sticky;
    bottom: 0;
    background: var(--fms-surface);
    border-top: 1px solid var(--fms-line);
    padding: 0.75rem 0 !important;
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px !important;
    padding-right: 12px !important;
    z-index: 1020;
    box-shadow: 0 -2px 8px rgba(20, 32, 43, .06);
  }
}

/* ==========================================================================
   대시보드
   ========================================================================== */

.fms-stat {
  display: block;
  background: var(--fms-surface);
  border: 1px solid var(--fms-line);
  border-radius: var(--fms-radius);
  padding: 0.9rem 1rem 1rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}

a.fms-stat:hover {
  border-color: var(--fms-brand-line);
  box-shadow: 0 3px 10px rgba(31, 92, 140, 0.10);
}

.fms-stat-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fms-muted);
  margin-bottom: 0.15rem;
}

.fms-stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--fms-ink);
  font-variant-numeric: tabular-nums;
}

.fms-stat-unit {
  font-size: 0.85rem;
  color: var(--fms-muted);
  margin-left: 0.15rem;
}

/* 처리할 게 남아 있을 때만 눈에 띄게 */
.fms-stat.is-warn {
  border-color: #e3c98d;
  background: var(--fms-warn-bg);
}
.fms-stat.is-warn .fms-stat-value,
.fms-stat.is-warn .fms-stat-label { color: var(--fms-warn); }

/* ---------- 목록 ---------- */

.fms-list { display: flex; flex-direction: column; }

.fms-list-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.25rem;
  border-top: 1px solid var(--fms-line-soft);
  text-decoration: none;
  color: inherit;
}

.fms-list-row:first-child { border-top: 0; }

.fms-list-row:hover {
  background: var(--fms-brand-tint);
  border-radius: var(--fms-radius-sm);
}

.fms-list-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.fms-list-main strong {
  font-weight: 600;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fms-list-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fms-list-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  text-align: right;
}

@media (max-width: 575.98px) {
  .fms-stat-value { font-size: 1.6rem; }
  .fms-list-meta { flex-direction: column; align-items: flex-end; gap: 0.15rem; }
}

/* ==========================================================================
   어두운 테마
   ========================================================================== */

[data-bs-theme="dark"] {
  --fms-brand:        #6fa8d4;
  --fms-brand-dark:   #8dbde3;
  --fms-brand-tint:   #1a2c3a;
  --fms-brand-line:   #325570;

  --fms-ink:          #e7edf3;
  --fms-ink-2:        #b2c0cc;
  --fms-muted:        #8695a3;

  --fms-bg:           #10161c;
  --fms-surface:      #18212a;
  --fms-surface-2:    #202b36;
  --fms-line:         #2c3945;
  --fms-line-soft:    #232f3a;

  --fms-ok:           #74c6a0;
  --fms-ok-bg:        #163025;
  --fms-warn:         #d7ac63;
  --fms-warn-bg:      #32270f;
  --fms-danger:       #e0847a;
  --fms-danger-bg:    #351c19;

  --bs-body-bg: var(--fms-bg);
  --bs-body-color: var(--fms-ink);
  --bs-border-color: var(--fms-line);
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .fms-stat {
  box-shadow: none;
}

[data-bs-theme="dark"] a.card:hover,
[data-bs-theme="dark"] a.fms-stat:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: var(--fms-surface-2);
  border-color: var(--fms-line);
  color: var(--fms-ink);
}

[data-bs-theme="dark"] .form-control::placeholder { color: #6c7a87; }

[data-bs-theme="dark"] .alert-success {
  border-color: #2c5943;
}

[data-bs-theme="dark"] .fms-stat.is-warn {
  border-color: #5c4a20;
}

/* 어두운 테마에서는 사진이 너무 튀지 않게 살짝 낮춥니다 */
[data-bs-theme="dark"] .fms-list-row img,
[data-bs-theme="dark"] .card img { filter: brightness(0.92); }

/* ---------- 테마 전환 버튼 ---------- */

.fms-theme-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  line-height: 1;
}

.dropdown-item.active {
  background: var(--fms-brand-tint);
  color: var(--fms-brand);
  font-weight: 600;
}

/* ---------- 로그인 화면 ---------- */

.fms-auth-body {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  padding-bottom: 1.25rem;   /* 기본 body 하단 여백 때문에 위로 밀리던 것을 되돌립니다 */
  background: var(--fms-bg);
  margin: 0;
}

.fms-auth-theme {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

.fms-auth-wrap {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.fms-auth-card {
  background: var(--fms-surface);
  border: 1px solid var(--fms-line);
  border-radius: 14px;
  padding: 2rem 1.75rem;
  box-shadow: 0 6px 28px rgba(20, 32, 43, 0.07);
}

[data-bs-theme="dark"] .fms-auth-card {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
}

.fms-auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.6rem;
}

.fms-auth-logo {
  width: 210px;
  max-width: 68%;
  height: auto;
}

.fms-only-dark { display: none; }
[data-bs-theme="dark"] .fms-only-light { display: none; }
[data-bs-theme="dark"] .fms-only-dark { display: block; }

.fms-auth-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.fms-auth-sub {
  font-size: 0.85rem;
  color: var(--fms-muted);
}

.fms-auth-card .form-control-lg {
  font-size: 1rem;
  min-height: 48px;
  border-radius: var(--fms-radius-sm);
}

.fms-auth-card .btn-lg {
  font-size: 1rem;
  min-height: 48px;
  border-radius: var(--fms-radius-sm);
}

.fms-auth-card .alert-danger {
  background: var(--fms-danger-bg);
  border-color: rgba(169, 58, 48, .25);
  color: var(--fms-danger);
  border-radius: var(--fms-radius-sm);
}

/* ==========================================================================
   화면 골격 — 아이콘 레일 + 메뉴 칸 + 본문
   ========================================================================== */

:root {
  --rail-w: 60px;
  --rail-w-open: 200px;
  --sub-w: 190px;
  --topbar-h: 56px;
  --rail-bg: #17466a;
  --rail-fg: #cddff0;
  --rail-fg-active: #ffffff;
}

[data-bs-theme="dark"] {
  --rail-bg: #111b25;
  --rail-fg: #91a4b6;
  --rail-fg-active: #ffffff;
}

body.fms-shell {
  padding-bottom: 0;
  min-height: 100svh;
  overflow-x: hidden;
}

/* ---------- 아이콘 레일 ---------- */

.fms-rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-w);
  background: var(--rail-bg);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .16s ease;
}

/* 마우스를 올리면 이름이 나오도록 넓어집니다 */
.fms-rail:hover,
.fms-rail:focus-within {
  width: var(--rail-w-open);
  box-shadow: 4px 0 18px rgba(10, 22, 34, .22);
}

.fms-rail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 14px;
  text-decoration: none;
  color: #fff;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}

/* 왼쪽 위 정사각형 자리 — 로고의 K 만 잘라 넣습니다 */
.fms-rail-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex: 0 0 auto;
  background: #fff;
  -webkit-mask: none;
  position: relative;
}

.fms-rail-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: #0f70b7;
  -webkit-mask: url("../img/mark.svg") no-repeat center / contain;
  mask: url("../img/mark.svg") no-repeat center / contain;
}

/* 레일이 넓어지면 나오는 KUKSUNG 글자 */
.fms-rail-word {
  width: 112px;
  height: 18px;
  background: #fff;
  -webkit-mask: url("../img/wordmark.svg") no-repeat left center / contain;
  mask: url("../img/wordmark.svg") no-repeat left center / contain;
  flex: 0 0 auto;
}

.fms-rail-nav {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  gap: 2px;
  overflow-y: auto;
  /* 레일이 좁을 때 숨겨진 글자 때문에 가로 스크롤 막대가 생기던 것을 막습니다 */
  overflow-x: hidden;
  scrollbar-width: none;
}

.fms-rail-nav::-webkit-scrollbar { width: 0; height: 0; }

.fms-rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 15px;
  color: var(--rail-fg);
  text-decoration: none;
  position: relative;
  white-space: nowrap;
}

.fms-rail-item:hover {
  color: var(--rail-fg-active);
  background: rgba(255, 255, 255, .08);
}

.fms-rail-item.is-active {
  color: var(--rail-fg-active);
  background: rgba(255, 255, 255, .13);
}

.fms-rail-item.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: #fff;
  border-radius: 0 3px 3px 0;
}

.fms-ic {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}
.fms-ic svg { width: 21px; height: 21px; }

/* 이름은 레일이 넓어졌을 때만 보입니다 */
.fms-rail-label {
  font-size: .9rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity .12s ease;
  pointer-events: none;
}
.fms-rail:hover .fms-rail-label,
.fms-rail:focus-within .fms-rail-label { opacity: 1; }

.fms-rail-brand .fms-rail-label { font-weight: 700; letter-spacing: -.02em; }

/* ---------- 두 번째 칸 ---------- */

.fms-sub {
  position: fixed;
  inset: 0 auto 0 var(--rail-w);
  width: var(--sub-w);
  background: var(--fms-surface);
  border-right: 1px solid var(--fms-line);
  z-index: 1030;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.fms-sub-title {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.02em;
  border-bottom: 1px solid var(--fms-line);
  flex: 0 0 auto;
}

.fms-sub-nav { padding: 10px 10px; display: flex; flex-direction: column; gap: 1px; }

.fms-sub-item {
  display: block;
  padding: 9px 12px;
  border-radius: var(--fms-radius-sm);
  color: var(--fms-ink-2);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
}

.fms-sub-item:hover { background: var(--fms-surface-2); color: var(--fms-ink); }

.fms-sub-item.is-active {
  background: var(--fms-brand-tint);
  color: var(--fms-brand);
  font-weight: 600;
}

.fms-sub-item.is-soon { color: var(--fms-steel-2, #9aa5b1); cursor: default; }
.fms-sub-item.is-soon em {
  font-style: normal;
  font-size: .72rem;
  margin-left: 6px;
  color: var(--fms-muted);
}

/* ---------- 본문 ---------- */

.fms-main {
  margin-left: calc(var(--rail-w) + var(--sub-w));
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.fms-topbar {
  height: var(--topbar-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: var(--fms-surface);
  border-bottom: 1px solid var(--fms-line);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.fms-topbar-title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.02em;
  flex: 1 1 auto;
}

.fms-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.fms-user { display: flex; align-items: center; gap: 10px; }

.fms-user-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
  text-align: right;
}
.fms-user-text strong { font-size: .88rem; font-weight: 600; }
.fms-user-text span { font-size: .74rem; color: var(--fms-muted); }

.fms-content { padding: 26px 14px 64px; flex: 1 1 auto; }
.fms-page { max-width: 1180px; margin-left: 0; }

.fms-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--fms-line);
  border-radius: var(--fms-radius-sm);
  width: 38px; height: 38px;
  color: var(--fms-ink-2);
  padding: 0;
  place-items: center;
}
.fms-menu-btn svg { width: 20px; height: 20px; }

.fms-backdrop { display: none; }

/* ---------- 좁은 화면 ---------- */

@media (max-width: 991.98px) {
  .fms-rail, .fms-sub {
    transition: transform .2s ease;
    will-change: transform;
  }

  /* 평소에는 화면 왼쪽 밖으로 완전히 밀어 둡니다 */
  .fms-rail {
    width: var(--rail-w-open);
    transform: translateX(-100%);
  }
  .fms-rail:hover, .fms-rail:focus-within { box-shadow: none; }
  .fms-rail .fms-rail-label { opacity: 1; }

  /* 메뉴 칸은 레일 오른쪽에 붙어 있으므로 레일 너비만큼 더 밀어야 완전히 숨습니다 */
  .fms-sub {
    left: var(--rail-w-open);
    transform: translateX(calc(-100% - var(--rail-w-open)));
  }

  body.fms-nav-open .fms-rail,
  body.fms-nav-open .fms-sub { transform: translateX(0); }
  body.fms-nav-open { overflow: hidden; }

  body.fms-nav-open .fms-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 34, .45);
    z-index: 1025;
  }

  .fms-main { margin-left: 0; }
  .fms-menu-btn { display: grid; }
  .fms-topbar { padding: 0 12px; gap: 8px; }
  .fms-topbar-title { font-size: .95rem; }
  .fms-content { padding: 16px 12px 72px; }
  .fms-user-text { display: none; }
  .fms-user-out .btn { padding: .25rem .6rem; font-size: .8rem; }
}

@media (max-width: 575.98px) {
  .fms-sub { width: calc(100vw - var(--rail-w-open) - 28px); }
}
