/* ==========================================================================
   SMART TOILET — 전체 스타일시트
   색·간격은 :root 변수만 바꾸면 전체가 따라옵니다.
   ========================================================================== */

:root {
  --primary: #696cff;
  --primary-dark: #5f61e6;
  --primary-soft: #e7e7ff;
  --info: #03c3ec;
  --success: #71dd37;
  --warning: #ffab00;
  --error: #ff3e1d;

  --bg: #f5f5f9;
  --surface: #fff;
  --border: #e4e4ee;
  --text: #32475c;
  --text-muted: #8592a3;
  --header-blue: #2196f3;

  --radius: 6px;
  --shadow: 0 2px 6px rgba(67, 89, 113, 0.12);
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --content-max: 1440px;
  color-scheme: light;
}

html[data-theme='dark'] {
  --primary-soft: rgba(105, 108, 255, 0.16);
  --bg: #232333;
  --surface: #2b2c40;
  --border: rgba(230, 230, 241, 0.12);
  --text: #e6e6f1;
  --text-muted: #aab3de;
  --shadow: 0 2px 6px rgba(20, 20, 29, 0.2);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  overflow: hidden scroll;
}

body {
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-weight: 600;
}

p {
  margin: 0 0 8px;
}

a {
  color: var(--primary);
  text-decoration: none;
}

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

.spacer {
  flex: 1 1 auto;
}

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

/* --- 초기 로딩: 원본 loader.css 구조 ----------------------------------- */

#loading-bg {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--initial-loader-bg, #fff);
  block-size: 100%;
  gap: 1rem 0;
  inline-size: 100%;
}

.loading {
  position: relative;
  box-sizing: border-box;
  border: 3px solid transparent;
  border-radius: 50%;
  block-size: 55px;
  inline-size: 55px;
}

.loading .effect-1,
.loading .effect-2,
.loading .effect-3 {
  position: absolute;
  box-sizing: border-box;
  border: 3px solid transparent;
  border-radius: 50%;
  block-size: 100%;
  border-inline-start: 3px solid var(--initial-loader-color, #eee);
  inline-size: 100%;
}

.loading .effect-1 {
  animation: rotate 1s ease infinite;
}

.loading .effect-2 {
  animation: rotate-opacity 1s ease infinite 0.1s;
}

.loading .effect-3 {
  animation: rotate-opacity 1s ease infinite 0.2s;
}

.loading .effects {
  transition: all 0.3s ease;
}

@keyframes rotate {
  0% { transform: rotate(0deg) }
  100% { transform: rotate(1turn) }
}

@keyframes rotate-opacity {
  0% {
    opacity: 0.1;
    transform: rotate(0deg);
  }

  100% {
    opacity: 1;
    transform: rotate(1turn);
  }
}

/* --- 레이아웃 ----------------------------------------------------------- */

.layout {
  display: flex;
  min-height: 100dvh;
  width: 100%;
}

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

.sidebar {
  display: none;
}

.sidebar-overlay {
  display: none;
}

.desktop-shell {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.app-logo-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.15px;
  line-height: 1.75rem;
}

.topbar {
  height: var(--topbar-h);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  max-width: none;
  margin-inline: auto;
  padding-inline: 24px;
}

.mobile-topbar {
  display: none;
}

.horizontal-nav {
  padding-block: 10px;
}

.horizontal-nav-inner {
  width: 100%;
  max-width: none;
  margin-inline: auto;
  padding-inline: 24px;
}

.content {
  flex: 1 1 auto;
  width: 100%;
  padding: 32px 24px;
  min-width: 0;
}

.menu-btn {
  display: none;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.icon-btn:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

/* --- 내비게이션 --------------------------------------------------------- */

.nav-items,
.nav-group-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link,
.nav-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nav-link:hover,
.nav-group-label:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-bullet {
  opacity: 0.55;
}

.nav-arrow {
  margin-left: auto;
  transition: transform 0.2s;
}

.nav-group-children {
  display: none;
}

.nav-group.open > .nav-group-children {
  display: block;
}

.horizontal-nav .nav-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.horizontal-nav .nav-item,
.horizontal-nav .nav-group {
  position: relative;
}

.horizontal-nav .nav-link,
.horizontal-nav .nav-group > .nav-group-label {
  width: auto;
  min-height: 42px;
  padding: 10px 16px;
  white-space: nowrap;
}

.horizontal-nav > .horizontal-nav-inner > .horizontal-nav-content > .nav-items > .nav-group.active > .nav-group-label {
  color: var(--primary);
  background: var(--primary-soft);
}

.horizontal-nav .nav-group-children {
  position: absolute;
  z-index: 70;
  top: calc(100% + 4px);
  left: 0;
  min-width: 192px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(67, 89, 113, 0.14);
}

.horizontal-nav .nav-group:hover > .nav-group-children,
.horizontal-nav .nav-group:focus-within > .nav-group-children,
.horizontal-nav .nav-group.open > .nav-group-children {
  display: block;
}

.horizontal-nav .nav-group-children .nav-group-children {
  top: -8px;
  left: calc(100% + 6px);
}

.horizontal-nav .nav-group-children .nav-link,
.horizontal-nav .nav-group-children .nav-group-label {
  width: 100%;
  min-height: 38px;
  margin-bottom: 2px;
  padding: 8px 10px;
}

.horizontal-nav .nav-group-children > :last-child > .nav-link,
.horizontal-nav .nav-group-children > :last-child > .nav-group-label {
  margin-bottom: 0;
}

.horizontal-nav .nav-group-children .nav-item-title {
  margin-right: 16px;
}

.horizontal-nav .nav-group.open > .nav-group-label .nav-arrow {
  transform: rotate(180deg);
}

.horizontal-nav .nav-group.sub-item.open > .nav-group-label .nav-arrow {
  transform: rotate(90deg);
}

.sidebar .nav-items {
  flex: 1 1 auto;
  padding: 4px 12px 16px;
  overflow-y: auto;
}

.sidebar .nav-link,
.sidebar .nav-group-label {
  min-height: 42px;
  margin-bottom: 4px;
  padding: 8px 15px;
}

.sidebar > .nav-items > .nav-item > .nav-link.active,
.sidebar > .nav-items > .nav-group.active > .nav-group-label {
  color: #fff;
  background: var(--primary);
}

.sidebar .nav-group.open > .nav-group-label .nav-arrow {
  transform: rotate(90deg);
}

.sidebar .nav-group-children {
  padding-left: 14px;
  margin-left: 20px;
  border-left: 1px solid var(--border);
}

/* --- 사용자 메뉴 -------------------------------------------------------- */

.user-menu-wrap {
  position: relative;
}

.user-trigger {
  border: 0;
  background: transparent;
  padding: 4px;
  cursor: pointer;
  line-height: 0;
  border-radius: 50%;
}

.user-trigger:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.avatar-badge {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-soft);
}

.avatar-status {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--success);
}

.user-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 14px);
  width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 30;
}

.user-menu.open {
  display: block;
}

.user-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
}

.user-name {
  font-weight: 600;
}

.user-level {
  font-size: 13px;
  color: var(--text-muted);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.user-menu-item:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

/* --- 상단바 테마/언어 메뉴 --------------------------------------------- */

.toolbar-menu-wrap {
  position: relative;
}

.toolbar-trigger {
  min-width: 38px;
  min-height: 38px;
}

.toolbar-trigger-icon {
  display: inline-flex;
}

.toolbar-menu {
  display: none;
  position: absolute;
  z-index: 70;
  top: calc(100% + 14px);
  right: 0;
  width: 180px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toolbar-menu-wrap.open > .toolbar-menu {
  display: block;
}

.language-menu {
  width: 175px;
}

.toolbar-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.toolbar-menu-item:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.toolbar-menu-item.selected {
  color: var(--primary);
  background: var(--primary-soft);
}

.selection-mark {
  margin-left: auto;
  visibility: hidden;
}

.toolbar-menu-item.selected .selection-mark {
  visibility: visible;
}

/* --- 페이지 / 그리드 시스템 --------------------------------------------- */

.page {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.page.narrow {
  max-width: 100%;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.page-brand {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.page-brand-title {
  font-size: 28px;
  font-weight: 600;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -8px;
}

.row + .row {
  margin-top: 8px;
}

.col {
  padding: 0 8px 12px;
  min-width: 0;
}

.col-actions {
  display: flex;
  align-items: flex-end;
  margin-left: auto;
}

.col-1 { width: 8.333% }
.col-2 { width: 16.666% }
.col-3 { width: 25% }
.col-4 { width: 33.333% }
.col-5 { width: 41.666% }
.col-6 { width: 50% }
.col-7 { width: 58.333% }
.col-8 { width: 66.666% }
.col-9 { width: 75% }
.col-10 { width: 83.333% }
.col-11 { width: 91.666% }
.col-12 { width: 100% }

@media (min-width: 960px) {
  .col-md-1 { width: 8.333% }
  .col-md-2 { width: 16.666% }
  .col-md-3 { width: 25% }
  .col-md-4 { width: 33.333% }
  .col-md-5 { width: 41.666% }
  .col-md-6 { width: 50% }
  .col-md-7 { width: 58.333% }
  .col-md-8 { width: 66.666% }
  .col-md-9 { width: 75% }
  .col-md-10 { width: 83.333% }
  .col-md-11 { width: 91.666% }
  .col-md-12 { width: 100% }
  .col-md-auto { width: auto }

  .page {
    max-width: 900px;
  }

  .page.narrow {
    max-width: 50%;
  }
}

@media (min-width: 1280px) {
  .page {
    max-width: 1200px;
  }

  .page.narrow {
    max-width: 41.666%;
  }
}

@media (min-width: 1920px) {
  .page {
    max-width: 1440px;
  }

  .page.narrow {
    max-width: 41.666%;
  }
}

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

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.card-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-header-row > span:first-child {
  margin-right: auto;
}

.card-body {
  padding: 20px;
}

.card-flush > .card-body {
  padding: 0;
}

/* --- 폼 ----------------------------------------------------------------- */

.field {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.field-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s;
}

.field-control:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(105, 108, 255, 0.12);
}

.field-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 9px 12px;
  font: inherit;
  color: inherit;
  border-radius: var(--radius);
}

.field-input[readonly] {
  color: var(--text-muted);
}

.field-append {
  border: 0;
  background: transparent;
  padding: 0 10px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.radio-group {
  display: flex;
  gap: 16px;
  align-items: center;
  min-height: 41px;
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.form-error {
  color: var(--error);
  font-size: 13px;
  min-height: 20px;
  margin: 0 0 4px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: filter 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn:hover {
  filter: brightness(0.94);
}

.btn-small {
  padding: 5px 12px;
  font-size: 13px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-filled.btn-primary { background: var(--primary); color: #fff }
.btn-filled.btn-success { background: var(--success); color: #fff }
.btn-filled.btn-info { background: var(--info); color: #fff }
.btn-filled.btn-error { background: var(--error); color: #fff }

.btn-outlined {
  background: transparent;
}

.btn-outlined.btn-primary { border-color: var(--primary); color: var(--primary) }
.btn-outlined.btn-success { border-color: var(--success); color: var(--success) }
.btn-outlined.btn-info { border-color: var(--info); color: var(--info) }
.btn-outlined.btn-error { border-color: var(--error); color: var(--error) }

.btn-outlined:hover {
  background: rgba(105, 108, 255, 0.06);
  filter: none;
}

/* --- 데이터 그리드 ------------------------------------------------------ */

.grid {
  position: relative;
}

.grid-scroll {
  overflow: auto;
}

.grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  white-space: nowrap;
}

.grid-table th,
.grid-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.grid-table thead th {
  position: sticky;
  top: 0;
  background: #f7f7fa;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  z-index: 1;
  user-select: none;
}

.grid-sortable {
  cursor: pointer;
}

.grid-sort-arrow {
  margin-left: 4px;
  font-size: 10px;
  color: var(--primary);
}

.grid-th-narrow,
.grid-td-narrow {
  width: 44px;
  text-align: center !important;
}

.grid-table tbody tr:hover {
  background: #fafafc;
}

.grid-row-new {
  background: rgba(113, 221, 55, 0.08);
}

.grid-td-click {
  cursor: pointer;
}

.grid-td-edit {
  padding: 4px 8px;
}

.grid-editor {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 6px;
  font: inherit;
  background: transparent;
}

.grid-editor:hover {
  border-color: var(--border);
}

.grid-editor:focus {
  outline: 0;
  border-color: var(--primary);
  background: #fff;
}

.grid-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

/* --- 차트 --------------------------------------------------------------- */

.chart {
  position: relative;
}

.chart-title {
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
}

.chart-plot {
  width: 100%;
}

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
}

.chart-gridline {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-axis {
  stroke: #c8c8d6;
  stroke-width: 1;
}

.chart-axis-label {
  font-size: 11px;
  fill: var(--text-muted);
}

.chart-axis-title {
  font-size: 12px;
  fill: var(--text-muted);
}

.chart-crosshair {
  stroke: var(--text-muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.chart-zoomband {
  fill: rgba(105, 108, 255, 0.15);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend-item i {
  width: 10px;
  height: 3px;
  border-radius: 2px;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(50, 71, 92, 0.92);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 5;
}

.chart-tooltip-time {
  opacity: 0.75;
  margin-bottom: 2px;
}

/* --- 스테퍼 ------------------------------------------------------------- */

.stepper {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}

.step {
  position: relative;
  padding-bottom: 8px;
}

.step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.step-marker {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-muted);
  z-index: 1;
}

.step-marker.step-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(105, 108, 255, 0.4);
}

.step-marker.step-done {
  background: var(--primary-soft);
  color: var(--primary);
}

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

.step-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.step-body {
  padding-left: 44px;
}

.step-content {
  padding-bottom: 8px;
}

.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
}

/* --- 측정값 표시 -------------------------------------------------------- */

.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stat-header {
  background: var(--header-blue);
  color: #fff;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  padding: 4px;
}

.stat-body {
  text-align: center;
  padding: 8px 4px;
}

.stat-value {
  font-size: 30px;
  font-weight: 600;
  margin-right: 4px;
}

.stat-unit {
  color: var(--text-muted);
}

.progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 0;
}

.progress-ring {
  width: 80px;
  height: 80px;
  border: 10px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-text {
  color: var(--text-muted);
}

.measure-updated {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 4px;
}

.alert {
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 8px 0;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.alert-success { background: rgba(113, 221, 55, 0.14); color: #5aa82a }
.alert-info { background: rgba(3, 195, 236, 0.14); color: #0295b3 }
.alert-warning { background: rgba(255, 171, 0, 0.14); color: #c98600 }
.alert-error { background: rgba(255, 62, 29, 0.14); color: #cc3117 }

/* --- 다이얼로그 --------------------------------------------------------- */

.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(50, 71, 92, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.dialog {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.dialog-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  font-weight: 600;
}

.dialog-header > span:first-child {
  flex: 1 1 auto;
}

.dialog-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.dialog-body {
  padding: 20px;
  overflow-y: auto;
}

/* --- 홈 ----------------------------------------------------------------- */

.home-card-title {
  color: #fff;
}

.home-info > .card-header {
  background: var(--primary);
  color: #fff;
  border-bottom: 0;
  padding: 8px 20px;
}

.home-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 0;
}

.home-name {
  font-size: 20px;
  font-weight: 600;
}

.home-start {
  background: #e8eaf6;
}

.home-start-head {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.home-start-title {
  font-size: 30px;
  font-weight: 600;
}

.home-start-desc {
  color: var(--text-muted);
  margin: 8px 0 16px;
}

/* --- 로그인 ------------------------------------------------------------- */

.blank-layout {
  position: relative;
  min-height: 100vh;
}

.login-brand {
  position: absolute;
  z-index: 2;
  top: 40px;
  left: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.login-brand-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.15px;
  line-height: 1.75rem;
}

.login-page {
  display: flex;
  min-height: 100vh;
}

.login-aside {
  flex: 1 1 auto;
  display: none;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
  background: var(--bg);
}

.login-logo {
  width: 40%;
  margin: auto;
  display: block;
}

.login-notice {
  flex: 0 0 auto;
  margin: 0;
}

.login-main {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--surface);
}

.login-box {
  width: 100%;
  max-width: 500px;
}

.login-title {
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 4px;
}

.login-desc {
  color: var(--text-muted);
  margin-bottom: 20px;
}

@media (min-width: 960px) {
  .login-aside {
    display: flex;
  }

  .login-main {
    flex: 0 0 33.333%;
  }
}

/* --- 404 ---------------------------------------------------------------- */

.misc-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
}

.misc-code {
  font-size: 64px;
  color: var(--primary);
}

.misc-desc {
  color: var(--text-muted);
}

.misc-image {
  max-width: 500px;
  width: 100%;
  margin-top: 24px;
}

/* --- 반응형 ------------------------------------------------------------- */

@media (max-width: 1279px) {
  body.nav-drawer-open {
    overflow: hidden;
  }

  .desktop-shell {
    display: none;
  }

  .mobile-topbar {
    position: sticky;
    top: 16px;
    z-index: 20;
    display: block;
    height: var(--topbar-h);
    padding-inline: 24px;
  }

  .mobile-topbar .topbar-inner {
    max-width: var(--content-max);
    padding-inline: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: none;
    backdrop-filter: blur(3px);
  }

  .menu-btn {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    height: 100dvh;
    overflow: hidden;
    border-right: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    transform: translateX(-100%);
    transition: transform 0.25s ease-in-out;
    will-change: transform;
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    min-height: 64px;
    margin-top: 12px;
    padding: 8px;
  }

  .sidebar-header .brand {
    min-width: 0;
    margin-right: auto;
  }

  .sidebar-header .app-logo-title {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .layout.nav-open .sidebar {
    transform: none;
  }

  .layout.nav-open .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(34, 48, 62, 0.5);
  }

  .content {
    padding-top: 32px;
  }
}

@media (max-width: 767px) {
  .mobile-topbar {
    top: 12px;
    padding-inline: 12px;
  }

  .mobile-topbar .topbar-inner {
    padding-inline: 12px;
  }

  .content {
    padding: 28px 12px 12px;
  }

  .card-body {
    padding: 14px;
  }
}

/* 하드코딩된 밝은 면도 테마 전환 시 원본의 dark palette를 따릅니다. */
html[data-theme='dark'] .grid-table thead th,
html[data-theme='dark'] .grid-table tbody tr:hover {
  background: #313246;
}

html[data-theme='dark'] .grid-editor:focus {
  background: var(--surface);
}

html[data-theme='dark'] .home-start {
  background: rgba(105, 108, 255, 0.12);
}

html[data-theme='dark'] .horizontal-nav .nav-group-children {
  box-shadow: 0 4px 12px rgba(20, 20, 29, 0.24);
}
