:root {
  --primary: #7b86cc;
  --primary-dk: #6470bb;
  --primary-lt: #eef0fb;
  --yellow: #ffe58f;
  --yellow-dk: #ffdb66;
  --yellow-lt: #fff1c4;
  --green: #7bc655;
  --green-dk: #5ea83d;
  --green-lt: #f0f9ea;
  --white: #ffffff;
  --bg: #f2f2f2;
  --gray-light: #efefef;
  --gray: #dedede;
  --navbar-bg: #474c71;
  --text: #333333;
  --text-sub: #888888;
  --danger: #c0392b;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ===== Site Header ===== */
.site-header {
  background: var(--navbar-bg);
  padding: 20px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.header-brand {
  color: var(--white);
  font-weight: 600;
  font-size: 18px;
}
.header-meta {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.btn-header-action,
.btn-logout {
  display: inline-block;
  background: transparent;
  text-decoration: none;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-header-action:hover,
.btn-logout:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ===== Layout Wrapper ===== */
html {
  height: 100%;
}
body {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.site-header {
  flex-shrink: 0;
}
.layout-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.site-footer {
  flex-shrink: 0;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #d2d4e1;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}
.sidebar-left {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-right {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-nav-item {
  display: block;
  padding: 12px 24px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition:
    background 0.15s,
    color 0.15s;
  border-left: 3px solid transparent;
}
.nav-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}
.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}
.sidebar-nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border-left-color: var(--primary);
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  padding: 30px 60px 60px;
  min-width: 0;
  background: #fafbfc;
  overflow-y: auto;
  scrollbar-width: none;
}
.main-content::-webkit-scrollbar {
  display: none;
}

/* ===== Site Footer ===== */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  height: 55px;
  font-size: 12px;
  color: var(--text-sub);
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 60px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 13px;
  box-shadow: var(--shadow);
  transition:
    opacity 0.3s,
    transform 0.3s;
  max-width: 360px;
}
.toast-success {
  background: var(--green-lt);
  color: var(--green-dk);
  border: 1px solid var(--green);
}
.toast-warning {
  background: var(--yellow-lt);
  color: #7a5000;
  border: 1px solid var(--yellow-dk);
}
.toast-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #f5c0bb;
}

/* ===== Modal ===== */
body.modal-open {
  overflow: hidden;
}
.password-modal-overlay[hidden] {
  display: none !important;
}
.password-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10000;
}
.password-modal {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}
.password-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
}
.password-modal-title {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}
.password-modal-close {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.password-modal-form {
  padding: 0 20px 20px;
}
.password-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.password-modal-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.password-modal-field input {
  border: 1px solid var(--gray);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 14px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.password-modal-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(123, 134, 204, 0.18);
}
.password-modal-help {
  margin: 2px 0 0;
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.5;
}
.password-modal-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #f5c0bb;
  color: var(--danger);
  font-size: 13px;
}
.password-modal-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--yellow-lt);
  border: 1px solid var(--yellow-dk);
  color: #7a5000;
  font-size: 13px;
  line-height: 1.5;
}
.password-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.password-modal-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.password-modal-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}
.password-modal-btn-secondary {
  background: var(--white);
  border-color: var(--gray);
  color: var(--text);
}
.password-modal-btn-primary {
  background: var(--primary);
  color: var(--white);
}
.password-modal-btn-primary:hover {
  background: var(--primary-dk);
}

/* ===== 햄버거 버튼 (모바일) ===== */
.btn-sidebar-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

/* ===== 사이드바 배경 오버레이 (모바일) ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
}

/* ===== 모바일 ===== */
@media (max-width: 768px) {

  .header-brand {
    font-size: 14px;
  }

  .btn-header-action,
  .btn-logout {
    font-size: 12px;
    padding: 5px 10px;
  }

  .header-meta {
    display: none;
  }

  .header-right {
    margin-left: auto;
  }

  .btn-sidebar-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 1000;
    width: 220px;
    transition: transform 0.25s ease;
  }
  .sidebar-left {
    left: 0;
    transform: translateX(-100%);
  }
  .sidebar-right {
    right: 0;
    transform: translateX(100%);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-overlay.is-open {
    display: block;
  }
  /* 양쪽 사이드바 모두 숨김 */
  .sidebar-left,
  .sidebar-right {
    display: none;
  }
  /* 햄버거 버튼 숨김 */
  .btn-sidebar-toggle {
    display: none;
  }

  body {
    overflow: auto;
    height: auto;
  }
  html {
    height: auto;
  }
  .layout-wrapper {
    overflow: visible;
  }
  .main-content {
    overflow: visible;
    padding: 16px 16px 40px;
  }
  .password-modal {
    max-width: 100%;
  }
}
