/* ==========================================================================
   유플렉스(UFLEX) — design system
   토큰 → 기본 → 레이아웃 → 컴포넌트 → 스케줄 그리드 → 유틸 순서.
   페이지별 CSS 는 만들지 않는다. 필요한 것은 여기에 컴포넌트로 추가한다.
   ========================================================================== */

/* ── 1. 토큰 ─────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui,
          "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --overlay: rgba(13, 19, 33, .45);

  --border: rgba(13, 19, 33, .08);
  --border-strong: rgba(13, 19, 33, .16);

  --text: #0d1321;
  --text-2: #4b5568;
  --text-3: #8a93a5;

  /* 강조색 = 로고의 루비 레드. 상태색 critical(#d03b3b)과 색상이 가까우므로
     위험 버튼은 '채움'이 아니라 '테두리' 스타일로 구분한다 (.btn--danger) */
  --accent: #d4163f;
  --accent-hover: #b51235;
  --accent-ink: #ffffff;
  --accent-soft: rgba(212, 22, 63, .08);
  --accent-ring: rgba(212, 22, 63, .24);

  /* 상태색은 고정(예약). 항상 아이콘/점 + 글자와 함께 쓴다 — 색만으로 의미를 전달하지 않는다 */
  --good: #0ca30c;      --good-soft: rgba(12, 163, 12, .11);
  --warn: #fab219;      --warn-soft: rgba(250, 178, 25, .16);
  --serious: #ec835a;   --serious-soft: rgba(236, 131, 90, .15);
  --critical: #d03b3b;  --critical-soft: rgba(208, 59, 59, .11);
  --info: #2a78d6;      --info-soft: rgba(42, 120, 214, .11);

  --shadow-1: 0 1px 2px rgba(13, 19, 33, .05);
  --shadow-2: 0 4px 16px -4px rgba(13, 19, 33, .10), 0 1px 2px rgba(13, 19, 33, .05);
  --shadow-3: 0 24px 56px -12px rgba(13, 19, 33, .28), 0 4px 12px rgba(13, 19, 33, .08);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --sidebar-w: 252px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0c11;
  --surface: #11141b;
  --surface-2: #161a23;
  --surface-3: #1d222d;
  --overlay: rgba(0, 0, 0, .62);

  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);

  --text: #eef1f7;
  --text-2: #a9b2c3;
  --text-3: #6c7588;

  --accent: #ff4f75;
  --accent-hover: #ff6d8c;
  --accent-ink: #1a0509;
  --accent-soft: rgba(255, 79, 117, .14);
  --accent-ring: rgba(255, 79, 117, .36);

  --good-soft: rgba(12, 163, 12, .18);
  --warn-soft: rgba(250, 178, 25, .16);
  --serious-soft: rgba(236, 131, 90, .17);
  --critical-soft: rgba(208, 59, 59, .20);
  --info-soft: rgba(57, 135, 229, .18);
  --info: #3987e5;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 6px 20px -6px rgba(0, 0, 0, .6);
  --shadow-3: 0 28px 64px -12px rgba(0, 0, 0, .8);
}

/* ── 2. 기본 ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.icon {
  width: 18px; height: 18px; flex: none;
  stroke: currentColor; fill: none; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon--sm { width: 15px; height: 15px; }
.icon--lg { width: 22px; height: 22px; }

/* 얇은 스크롤바 */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ── 3. 레이아웃: 관리자(사이드바) ─────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 14px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff; overflow: hidden;
  background: #28040e url("../img/mark-96.png") center / cover no-repeat;
  box-shadow: 0 6px 16px -6px rgba(212, 22, 63, .65), inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.brand__mark .icon { display: none; }   /* 로고 이미지가 아이콘을 대신한다 */
.brand__name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; line-height: 1.2; }
.brand__sub { font-size: 11.5px; color: var(--text-3); letter-spacing: .02em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__label {
  padding: 14px 10px 6px; font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
}
.nav__item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav__item:hover { background: var(--surface-3); color: var(--text); }
.nav__item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav__badge {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
  background: var(--surface-3); color: var(--text-2);
}

.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.userchip { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border-radius: var(--r-sm); }
.userchip__text { min-width: 0; flex: 1; line-height: 1.25; }
.userchip__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userchip__role { font-size: 12px; color: var(--text-3); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--accent-soft); color: var(--accent);
}
.avatar--sm { width: 26px; height: 26px; font-size: 11.5px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.pagehead {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 32px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.pagehead__title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.pagehead__sub { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.pagehead__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.content { padding: 24px 32px 56px; display: flex; flex-direction: column; gap: 20px; }

.btn.menu-toggle { display: none; }

/* ── 4. 레이아웃: 사용자(상단바) ───────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 20px;
  height: 62px; padding: 0 28px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { padding: 0; }
.topnav { display: flex; gap: 2px; margin-left: 12px; }
.topnav__item {
  padding: 8px 13px; border-radius: var(--r-sm); font-weight: 500; color: var(--text-2);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.topnav__item:hover { background: var(--surface-3); color: var(--text); }
.topnav__item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 28px 64px; display: flex; flex-direction: column; gap: 20px; }

/* ── 5. 버튼 ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-weight: 600; font-size: 13.5px; white-space: nowrap; color: var(--text);
  box-shadow: var(--shadow-1);
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .08s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 1px 2px rgba(13,19,33,.12), inset 0 1px 0 rgba(255,255,255,.16); }
.btn--primary:hover { background: var(--accent-hover); border-color: transparent; }
.btn--danger { background: var(--surface); border-color: var(--critical); color: var(--critical); }
.btn--danger:hover { background: var(--critical-soft); border-color: var(--critical); }
.btn--ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn--lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.btn--block { width: 100%; }
.btn--icon { width: 36px; padding: 0; }
.btn--icon.btn--sm { width: 30px; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--text-3); border-top-color: transparent; animation: spin .7s linear infinite;
}
.btn--primary.is-loading::after { border-color: rgba(255,255,255,.85); border-top-color: transparent; }
.btn--danger.is-loading::after { border-color: var(--critical); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 6. 폼 ───────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field__hint { font-size: 12px; color: var(--text-3); }
.field__error { font-size: 12px; color: var(--critical); }
.req { color: var(--critical); }

.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.textarea { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; }
.input.is-invalid { border-color: var(--critical); box-shadow: 0 0 0 3px var(--critical-soft); }
.input--sm, .select--sm { height: 32px; font-size: 13px; padding: 0 10px; }
.input--mono { font-family: var(--mono); font-size: 13px; }
.select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a93a5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group > .icon { position: absolute; left: 11px; color: var(--text-3); pointer-events: none; }
.input-group > .icon ~ .input { padding-left: 35px; }
.input-group__btn { position: absolute; right: 4px; }
.input-group:has(.input-group__btn) .input { padding-right: 40px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; border-top: 1px solid var(--border); }
.form-section:first-child { padding-top: 0; border-top: 0; }
.form-section__title { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); transition: background .18s var(--ease); flex: none; position: relative; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .18s var(--ease); }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: .5; }

/* 세그먼트(요일 탭, 필터 토글) */
.segment { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-3); max-width: 100%; overflow-x: auto; }
.segment__item {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px;
  border: 0; border-radius: 7px; background: transparent; color: var(--text-2);
  font-weight: 600; font-size: 13px; white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.segment__item:hover { color: var(--text); }
.segment__item.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.segment__item.is-today::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.segment__count { font-size: 11px; font-weight: 600; padding: 0 5px; border-radius: 999px; background: var(--border); color: var(--text-2); line-height: 16px; }

/* ── 7. 카드 / 지표 ─────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.card__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card__title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card__sub { font-size: 12.5px; color: var(--text-3); }
.card__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card__body { padding: 20px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }

/* 지표 타일: 숫자는 본문 글자색, 색은 아이콘 칩에만 */
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.stat__top { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.stat__icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.stat__icon--good { background: var(--good-soft); color: var(--good); }
.stat__icon--warn { background: var(--warn-soft); color: #a86f00; }
.stat__icon--critical { background: var(--critical-soft); color: var(--critical); }
:root[data-theme="dark"] .stat__icon--warn { color: var(--warn); }
.stat__value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stat__unit { font-size: 15px; font-weight: 600; color: var(--text-3); margin-left: 3px; letter-spacing: 0; }
.stat__foot { font-size: 12.5px; color: var(--text-3); }

/* 사용량 트랙 */
.meter { display: flex; flex-direction: column; gap: 7px; }
.meter__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.meter__row strong { color: var(--text); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.meter__track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter__fill { height: 100%; min-width: 4px; border-radius: 999px; background: var(--accent); transition: width .5s var(--ease); }
.meter--warn .meter__fill { background: var(--warn); }
.meter--critical .meter__fill { background: var(--critical); }
.meter--good .meter__fill { background: var(--good); }
.meter--sm .meter__track { height: 5px; }

/* 원형 게이지: style="--p: 62" (0~100) */
.ring {
  --p: 0; --size: 108px; --thick: 10px; --ring-color: var(--accent);
  width: var(--size); height: var(--size); border-radius: 50%; flex: none; position: relative;
  display: grid; place-items: center;
  background: conic-gradient(var(--ring-color) calc(var(--p) * 1%), var(--surface-3) 0);
}
.ring::before { content: ""; position: absolute; inset: var(--thick); border-radius: 50%; background: var(--surface); }
.ring > * { position: relative; }
.ring--warn { --ring-color: var(--warn); }
.ring--critical { --ring-color: var(--critical); }
.ring--good { --ring-color: var(--good); }
.ring__value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1; text-align: center; }
.ring__label { font-size: 11px; color: var(--text-3); text-align: center; margin-top: 3px; }

/* ── 8. 상태 표시 ───────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex: none; }
.pill--good { background: var(--good-soft); color: var(--text); }        .pill--good .pill__dot { background: var(--good); }
.pill--warn { background: var(--warn-soft); color: var(--text); }        .pill--warn .pill__dot { background: var(--warn); }
.pill--serious { background: var(--serious-soft); color: var(--text); }  .pill--serious .pill__dot { background: var(--serious); }
.pill--critical { background: var(--critical-soft); color: var(--text); } .pill--critical .pill__dot { background: var(--critical); }
.pill--info { background: var(--info-soft); color: var(--text); }        .pill--info .pill__dot { background: var(--info); }
.pill--accent { background: var(--accent-soft); color: var(--accent); }   .pill--accent .pill__dot { background: var(--accent); }
.pill--live .pill__dot { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }

.tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }

.banner { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); }
.banner .icon { margin-top: 1px; }
.banner__title { font-weight: 700; }
.banner__text { font-size: 13px; color: var(--text-2); }
.banner__actions { margin-left: auto; display: flex; gap: 8px; align-self: center; }
.banner--info { background: var(--info-soft); border-color: transparent; }          .banner--info > .icon { color: var(--info); }
.banner--warn { background: var(--warn-soft); border-color: transparent; }          .banner--warn > .icon { color: #a86f00; }
.banner--critical { background: var(--critical-soft); border-color: transparent; }  .banner--critical > .icon { color: var(--critical); }
.banner--good { background: var(--good-soft); border-color: transparent; }          .banner--good > .icon { color: var(--good); }
:root[data-theme="dark"] .banner--warn > .icon { color: var(--warn); }

/* ── 9. 표 ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap;
  padding: 10px 16px; font-size: 12px; font-weight: 600; color: var(--text-3);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.is-clickable { cursor: pointer; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .nowrap { white-space: nowrap; }
.table .muted { color: var(--text-3); }
.table--dense td { padding: 8px 16px; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--text-3); }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar__spacer { flex: 1; }
.toolbar .input-group { width: 260px; max-width: 100%; }

.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; font-size: 13px; color: var(--text-2); }

/* ── 10. 빈 상태 / 스켈레톤 ─────────────────────────────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 52px 24px; text-align: center; color: var(--text-2); }
.empty__icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); }
.empty__title { font-size: 15px; font-weight: 700; color: var(--text); }
.empty__text { font-size: 13px; max-width: 380px; }

.skeleton { border-radius: 6px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── 11. 모달 / 드로어 / 토스트 / 메뉴 ─────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal.is-open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(3px); animation: fade .18s var(--ease); }
.modal__panel {
  position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-3); animation: pop .22s var(--ease);
}
.modal__panel--lg { max-width: 760px; }
.modal__panel--sm { max-width: 400px; }
.modal__head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 0; }
.modal__title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.modal__desc { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.modal__close { margin-left: auto; margin-top: -4px; margin-right: -6px; }
.modal__body { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.drawer { position: fixed; inset: 0; z-index: 90; display: none; }
.drawer.is-open { display: block; }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 100%); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-3); animation: slide .24s var(--ease); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 420px;
  padding: 11px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 500;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-3);
  animation: toast-in .25s var(--ease);
}
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.toast--error .icon { color: #ff8a8a; }
.toast--success .icon { color: #6ee06e; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.menu { position: relative; display: inline-flex; }
.menu__list {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; min-width: 190px; padding: 5px;
  display: none; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-2);
}
.menu.is-open .menu__list { display: flex; animation: pop .16s var(--ease); }
.menu__item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; text-align: left; font-size: 13.5px; font-weight: 500; color: var(--text); }
.menu__item:hover { background: var(--surface-3); }
.menu__item--danger { color: var(--critical); }
.menu__sep { height: 1px; margin: 4px 0; background: var(--border); }

/* ── 12. 스케줄 그리드 (5분 단위 테이블) ────────────────────────────────── */
/*
   <div class="sgrid" style="--sgrid-cols: 76px minmax(260px,2fr) minmax(140px,1fr) ...">
     <div class="sgrid__head"> <div class="sgrid__th">시간</div> ... </div>
     <div class="sgrid__body">
       <div class="sgrid__hour">09시 <span>입력 3 / 12</span></div>
       <div class="sgrid__row is-now"> <div class="sgrid__time">9:05</div> <div class="sgrid__cell">…</div> </div>
*/
.sgrid { --sgrid-cols: 76px minmax(260px, 2fr) minmax(140px, 1fr); display: flex; flex-direction: column; min-width: 0; }
.sgrid__scroll { overflow: auto; max-height: calc(100vh - 250px); min-height: 320px; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.sgrid__head, .sgrid__row { display: grid; grid-template-columns: var(--sgrid-cols); align-items: stretch; min-width: max-content; }
.sgrid__head { position: sticky; top: 0; z-index: 5; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.sgrid__th { padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--text-3); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.sgrid__hour {
  position: sticky; top: 38px; z-index: 4; display: flex; align-items: center; gap: 10px;
  padding: 6px 14px; font-size: 12px; font-weight: 700; color: var(--text-2);
  background: color-mix(in srgb, var(--surface-3) 92%, transparent); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border); border-top: 1px solid var(--border); margin-top: -1px;
}
.sgrid__hour span { font-weight: 500; color: var(--text-3); }
.sgrid__row { border-bottom: 1px solid var(--border); background: var(--surface); transition: background .12s var(--ease); position: relative; }
.sgrid__row:hover { background: var(--surface-2); }
.sgrid__time {
  display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 40px;
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13.5px; color: var(--text-2);
}
.sgrid__cell { display: flex; align-items: center; min-width: 0; padding: 0 4px; border-left: 1px solid var(--border); gap: 6px; }
.sgrid__cell--pad { padding: 0 12px; }
.sgrid__row.is-filled .sgrid__time { color: var(--text); }
.sgrid__row.is-past { opacity: .62; }
.sgrid__row.is-past:hover, .sgrid__row.is-past:focus-within { opacity: 1; }
.sgrid__row.is-now { background: var(--accent-soft); opacity: 1; }
.sgrid__row.is-now::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.sgrid__row.is-now .sgrid__time { color: var(--accent); }
.sgrid__row.is-selected { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.sgrid__row.is-locked .cell-input { color: var(--text-3); cursor: not-allowed; }
.sgrid__row.is-unassigned { background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--text) 2.5%, transparent) 8px 16px); }

.cell-input {
  width: 100%; height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text); font-size: 13.5px; min-width: 0;
  transition: border-color .12s var(--ease), background .12s var(--ease), box-shadow .12s var(--ease);
}
.cell-input::placeholder { color: transparent; }
.sgrid__row:hover .cell-input::placeholder, .cell-input:focus::placeholder { color: var(--text-3); }
.cell-input:hover:not(:disabled):not([readonly]) { border-color: var(--border-strong); background: var(--surface); }
.cell-input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-ring); }
.cell-input.is-invalid { border-color: var(--critical); background: var(--critical-soft); }
.cell-input--link { font-family: var(--mono); font-size: 12.5px; }

/* 저장 상태: 행 오른쪽 끝의 작은 점 */
.savedot { width: 7px; height: 7px; border-radius: 50%; flex: none; opacity: 0; transition: opacity .2s; }
.is-saving .savedot { opacity: 1; background: var(--warn); animation: blink 1s ease-in-out infinite; }
.is-saved .savedot { opacity: 1; background: var(--good); }
.is-error .savedot { opacity: 1; background: var(--critical); }
@keyframes blink { 50% { opacity: .35; } }

.thumb { width: 50px; height: 28px; border-radius: 5px; object-fit: cover; flex: none; background: var(--surface-3); border: 1px solid var(--border); }
.thumb--lg { width: 120px; height: 68px; border-radius: 8px; }

/* 선택 시 아래에서 올라오는 일괄 작업 바 */
.bulkbar {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, calc(100% + 48px)); visibility: hidden;
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; border-radius: 14px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-3);
  transition: transform .28s var(--ease), visibility 0s linear .28s;
}
.bulkbar.is-open { transform: translate(-50%, 0); visibility: visible; transition: transform .28s var(--ease), visibility 0s; }
.bulkbar__count { font-weight: 700; margin-right: 6px; font-variant-numeric: tabular-nums; }
.bulkbar .btn { background: transparent; border-color: color-mix(in srgb, var(--bg) 28%, transparent); color: var(--bg); box-shadow: none; }
.bulkbar .btn:hover { background: color-mix(in srgb, var(--bg) 14%, transparent); }

/* ── 13. 로그인 ─────────────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--surface); }
.login__hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px 52px; color: #fff;
  background:
    radial-gradient(820px 520px at 14% 6%, rgba(255, 60, 105, .42), transparent 60%),
    radial-gradient(720px 520px at 94% 98%, rgba(190, 18, 60, .40), transparent 58%),
    linear-gradient(150deg, #1d0309 0%, #3a0613 46%, #12020a 100%);
}
.login__logo { width: 132px; height: 132px; border-radius: 50%; margin-bottom: 28px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 18px 60px -12px rgba(255, 45, 95, .75); }
.login__hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 72%);
}
.login__hero > * { position: relative; z-index: 1; }
.login__hero .brand__name { color: #fff; }
.login__hero .brand__sub { color: rgba(255,255,255,.6); }
.login__headline { font-size: 38px; font-weight: 800; letter-spacing: -.035em; line-height: 1.18; max-width: 460px; }
.login__lead { margin-top: 16px; font-size: 15.5px; line-height: 1.65; color: rgba(255,255,255,.72); max-width: 430px; }
.login__points { display: grid; gap: 12px; margin-top: 32px; max-width: 430px; }
.login__point { display: flex; align-items: center; gap: 12px; font-size: 14px; color: rgba(255,255,255,.86); }
.login__point .icon { width: 30px; height: 30px; padding: 7px; border-radius: 9px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); }
.login__foot { font-size: 12.5px; color: rgba(255,255,255,.45); }
.login__side { display: grid; place-items: center; padding: 40px 28px; background: var(--bg); }
.login__card { width: 100%; max-width: 384px; display: flex; flex-direction: column; gap: 22px; }
.login__title { font-size: 25px; font-weight: 800; letter-spacing: -.03em; }
.login__desc { color: var(--text-2); margin-top: 5px; }
.login__form { display: flex; flex-direction: column; gap: 15px; }

/* ── 13-b. 보강 컴포넌트 ─────────────────────────────────────────────────── */
/* 목록형 피드 (대시보드 "주의 필요") */
.feed { display: flex; flex-direction: column; }
.feed__item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--border); transition: background .12s var(--ease); }
.feed__item:first-child { border-top: 0; }
a.feed__item:hover { background: var(--surface-2); }
.feed__meta { margin-left: auto; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
/* 링크 카드 */
a.card { transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
a.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }

/* 정렬 가능한 표 머리글 버튼 */
.th-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.th-sort .icon { opacity: .25; transition: transform .15s var(--ease), opacity .15s var(--ease); }
.th-sort:hover { color: var(--text); }
th[aria-sort="ascending"] .th-sort, th[aria-sort="descending"] .th-sort { color: var(--text); }
th[aria-sort="ascending"] .th-sort .icon { opacity: 1; transform: rotate(180deg); }
th[aria-sort="descending"] .th-sort .icon { opacity: 1; }
/* 큰 아바타 */
.avatar--lg { width: 56px; height: 56px; font-size: 22px; }
/* 값 요약 상자 */
.dl--box { padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }

/* ── 사용자 테이블 보강 (user/tables.html 의 .sgrid--user) ─────────────────── */
/* 고객 화면은 터치 기기가 많아 hover 가 없다 → 빈 칸의 안내 문구를 항상 보여준다 */
.sgrid--user .cell-input::placeholder { color: var(--text-3); }
.sgrid--user .sgrid__row.is-locked .cell-input::placeholder { color: transparent; }
/* 칸이 몇 개 없는 사용자에게 빈 공간이 크게 남지 않도록 */
.sgrid--user .sgrid__scroll { min-height: 0; }

/* 좁은 화면에서 가로 스크롤해도 시간 열은 고정. 행 상태 배경이 반투명이라 불투명 바탕이 필요하다 */
.sgrid__time { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.sgrid__row:hover .sgrid__time { background: var(--surface-2); }
.sgrid__row.is-now .sgrid__time { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.sgrid__row.is-selected .sgrid__time { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.sgrid__head .sgrid__th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface-2); }
/* 스크롤 영역 안쪽 래퍼: 시간대 구분 띠가 전체 폭을 덮도록 */
.sgrid__body { min-width: max-content; }
.drawer__panel .modal__foot { border-radius: 0; }

/* ── 13-c. 순위 추적 (차트 · 영상 행 · 채널 행) ─────────────────────────── */
.rk-chart { position: relative; width: 100%; outline: none; border-radius: var(--r-sm); }
.rk-chart:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.rk-chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.rk-chart__band { fill: var(--good-soft); }
.rk-chart__grid { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.rk-chart__axis { stroke: var(--border-strong); stroke-width: 1; shape-rendering: crispEdges; }
.rk-chart__tick { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.rk-chart__line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rk-chart__dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.rk-chart__out { fill: var(--surface); stroke: var(--text-3); stroke-width: 1.5; }
.rk-chart__cross { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.rk-chart__focus { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.rk-chart__focus--out { stroke: var(--text-2); }
.rk-tip { position: absolute; z-index: 3; pointer-events: none; min-width: 132px; padding: 9px 11px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-2); font-size: 12px; color: var(--text-2); line-height: 1.55; }
.rk-tip__time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.rk-tip__row { display: flex; justify-content: space-between; gap: 14px; }
.rk-tip__row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.rk-video { display: flex; align-items: center; gap: 11px; min-width: 0; }
.rk-video__text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rk-video__title { font-weight: 600; max-width: 340px; }
.rk-kw { display: flex; align-items: center; gap: 7px; min-width: 170px; }
.rk-kw .input { min-width: 0; }
.rk-open { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; min-width: 0; max-width: 100%; }
.rk-open:hover .rk-video__title, .rk-open:focus-visible .rk-video__title { color: var(--accent); }
.rk-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.rk-channel { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); min-height: 58px; }
.rk-channel:last-child { border-bottom: 0; }
.rk-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px 14px; }
.rk-rank-top { font-weight: 700; color: var(--text); }
@media (max-width: 900px) { .rk-video__title { max-width: 220px; } }
.link-button { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.link-button:hover { color: var(--accent); }
.card__foot--wrap, .modal__foot--wrap { flex-wrap: wrap; }

/* ── 13-d. 순위 추적 그래프의 '작업' 기준선 · 열이 많은 표 ─────────────────── */
.rk-chart__ref { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 4 3; }
.rk-chart__ref-label { fill: var(--text-2); font-size: 11px; font-weight: 700; }
.table--tight th, .table--tight td { padding-left: 10px; padding-right: 10px; }
.table th.th--wrap { white-space: normal; min-width: 96px; }
.table th.th--wrap .th-sort { line-height: 1.3; }
@media (max-width: 1439px) { .col-hide-narrow, #users-table .col-login { display: none; } }

/* ── 13-e. 넓은 표 · 큰 모달 · 알림 배지 ──────────────────────────────────── */
/* 열이 많은 표가 잘리지 않게: 감싸는 상자가 가로로 스크롤되고, 스크롤바가 항상 보인다 */
.table-wrap { overflow-x: auto; max-width: 100%; scrollbar-width: auto; scrollbar-color: var(--border-strong) var(--surface-2); -webkit-overflow-scrolling: touch; }
.table-wrap::-webkit-scrollbar { height: 12px; }
.table-wrap::-webkit-scrollbar-track { background: var(--surface-2); }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid var(--surface-2); }
.table-wrap > .table { min-width: max-content; }
.table-wrap > .table th:first-child, .table-wrap > .table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.table-wrap > .table th:first-child { z-index: 2; background: var(--surface-2); }
.table-wrap > .table tbody tr:hover td:first-child { background: var(--surface-2); }
.modal__panel--xl { max-width: min(1560px, 96vw); }
.modal__panel--xl .modal__body { overflow-x: hidden; }
.nav__badge--alert { background: var(--critical); color: #fff; }
.content, .page { min-width: 0; }

/* ── 13-f. 4차 보강 (로그인 소개 · 관리자 로그인 · 사용자 홈) ─────────────── */
/* authsplit */
/* (app.css 의 "13. 로그인" 구획 바로 뒤, 또는 파일 끝에 넣는다. 기존 .login__points / .login__point 규칙은 더 이상 쓰이지 않는다) */
/* 고객 로그인 왼쪽: 세 가지 장점 (아이콘 + 제목 + 설명) */
.login__values { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 18px; max-width: 470px; }
.login__value { display: flex; align-items: flex-start; gap: 14px; }
.login__value > .icon { flex: none; width: 36px; height: 36px; padding: 9px; border-radius: 11px; color: #fff;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); }
.login__value-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: #fff; }
.login__value-text { margin: 4px 0 0; font-size: 13.5px; line-height: 1.6; color: rgba(255,255,255,.7); word-break: keep-all; }
.login__headline, .login__lead { word-break: keep-all; }
@media (max-height: 800px) {
  .login__logo { width: 84px; height: 84px; margin-bottom: 18px; }
  .login__headline { font-size: 32px; }
  .login__values { margin-top: 22px; gap: 14px; }
}
/* 모바일에서는 왼쪽 소개가 숨겨지므로 폼 위에 작은 로고, 폼 아래에 짧은 요약을 보여 준다 */
.login__mvalues, .login__mbrand { display: none; }
.login__mbrand { align-items: center; gap: 12px; font-size: 15px; line-height: 1.35; }
.login__mbrand img { flex: none; width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 1px var(--border-strong); }
.login__mvalues-title { font-size: 14.5px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.login__mvalues-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.login__mvalue { display: flex; align-items: flex-start; gap: 11px; }
.login__mvalue > .icon { flex: none; width: 30px; height: 30px; padding: 7px; border-radius: 9px;
  color: var(--accent); background: var(--accent-soft); }
.login__mvalue-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.login__mvalue-text { margin-top: 2px; font-size: 12.5px; line-height: 1.5; color: var(--text-2); word-break: keep-all; }
@media (max-width: 900px) {
  .login__side { place-items: start center; padding: 40px 20px 32px; }
  .login__mbrand { display: flex; }
  .login__mvalues { display: block; padding-top: 20px; border-top: 1px solid var(--border); }
}

/* 관리자 로그인 (/admin/login): 고객 로그인과 헷갈리지 않게 어두운 배경 + 작은 카드 하나 */
.alogin-body { background: #12020a; }
.alogin {
  min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 18px;
  padding: 32px 16px;
  background:
    radial-gradient(640px 420px at 50% 0%, rgba(255, 60, 105, .26), transparent 62%),
    radial-gradient(560px 420px at 50% 110%, rgba(190, 18, 60, .22), transparent 60%),
    linear-gradient(160deg, #1d0309 0%, #12020a 55%, #07060a 100%);
}
.alogin__card {
  width: 100%; max-width: 372px; display: flex; flex-direction: column; gap: 20px; padding: 26px 24px 18px;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  box-shadow: 0 32px 80px -24px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .04);
}
.alogin__head { display: flex; align-items: center; gap: 13px; }
.alogin__logo { flex: none; width: 52px; height: 52px; border-radius: 50%; box-shadow: 0 0 0 1px var(--border-strong); }
.alogin__heading { min-width: 0; flex: 1; }
.alogin__title { font-size: 19px; font-weight: 800; letter-spacing: -.03em; line-height: 1.25; }
.alogin__sub { margin-top: 2px; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--text-2); }
.alogin__lock { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  color: var(--accent); background: var(--accent-soft); }
.alogin__lock .icon { width: 16px; height: 16px; }
.alogin__foot { margin: 0; font-size: 12px; color: rgba(255,255,255,.5); text-align: center; }
@media (max-width: 420px) { .alogin__card { padding: 22px 18px 14px; } }
/* userportal */
/* ── 사용자 홈 / 상단 메뉴 (user_portal) ─────────────────────────────── */
.topnav::-webkit-scrollbar { display: none; }
@media (max-width: 560px) {
  /* 좁은 화면: '작업결과 · 순위 추적' → '작업결과' 로 줄여 메뉴 3개가 한 줄에 들어가게 */
  .topbar .topnav__item { padding: 8px 8px; font-size: 13px; }
  .topnav__full { display: none; }
  /* 홈 지표 타일은 모바일에서 2열 (기본 .grid--4 는 1열) - 반드시 .grid--4 규칙보다 뒤에 둘 것 */
  .uh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .uh-stats .stat { padding: 14px; }
  .uh-stats .stat__value { font-size: 24px; }
}

/* ── 13-g. 5차 보강 (작업결과 · 고객 상단 메뉴 4개 · 펼친 행) ─────────────── */
.rs-ch { transition: background .15s var(--ease); }
.rs-ch:hover { background: var(--surface-2) !important; }
.rs-ch.is-active:hover { background: var(--accent-soft) !important; }
.rs-ch:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 0; }
.rs-ch:last-child { border-bottom: 0 !important; }
/* 표 안에서 전체 폭으로 펼친 행(colspan)은 '고정 첫 열' 규칙에서 빼야 고정 머리글을 덮지 않는다 */
.table-wrap > .table td[colspan]:first-child { position: static; }
@media (max-width: 560px) {
  .topbar { gap: 6px; padding: 0 10px; }
  .topbar .topnav__item { padding: 8px 6px; font-size: 12.5px; }
  .topbar__right { gap: 2px; }
  .topbar__right .menu > .btn { padding-left: 4px; padding-right: 4px; }
}
@media (max-width: 380px) { .topbar .topnav__item { padding: 8px 4px; font-size: 12px; } }

/* ── 14. 유틸 ───────────────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack--sm { gap: 6px; }
.stack--lg { gap: 20px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.strong { font-weight: 700; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.tnum { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }
.kbd { display: inline-block; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface-2); font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 20px; font-size: 13.5px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; font-weight: 500; min-width: 0; }

/* ── 15. 반응형 ─────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 80; left: 0; width: min(var(--sidebar-w), 84vw); transform: translateX(-102%); transition: transform .25s var(--ease); box-shadow: var(--shadow-3); }
  .shell.is-nav-open .sidebar { transform: none; }
  .shell.is-nav-open::after { content: ""; position: fixed; inset: 0; z-index: 70; background: var(--overlay); }
  .btn.menu-toggle { display: inline-flex; }
  .pagehead { padding: 14px 16px; }
  .content { padding: 16px 16px 48px; }
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login__hero { display: none; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topnav { margin-left: 0; }
  .page { padding: 18px 14px 56px; }
  .sgrid__scroll { max-height: none; }
  .toolbar .input-group { width: 100%; }
  .bulkbar { left: 12px; right: 12px; transform: translateY(calc(100% + 48px)); flex-wrap: wrap; }
  .bulkbar.is-open { transform: none; }
}
@media (max-width: 560px) {
  .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .topbar .brand__text { display: none; }
  .modal { padding: 0; align-items: flex-end; }
  .modal__panel { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .modal__foot { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
