:root {
  --bg: #09100f;
  --surface: #101a18;
  --surface-2: #152320;
  --line: #243431;
  --text: #f3f6f4;
  --muted: #91a29e;
  --accent: #54e2a6;
  --accent-deep: #0d5c42;
  --warning: #f6c35b;
  --danger: #ff786f;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
body { margin: 0; background: radial-gradient(circle at 75% 0%, #132721 0, var(--bg) 32%); color: var(--text); font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif; min-width: 320px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px; border-right: 1px solid var(--line); background: rgba(8, 15, 14, .88); backdrop-filter: blur(18px); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #052218; font-weight: 900; background: linear-gradient(135deg, #80f7c2, #28b57a); box-shadow: 0 8px 24px rgba(65, 215, 154, .2); }
.brand-mark.large { width: 48px; height: 48px; margin-bottom: 18px; }
nav { display: grid; gap: 7px; }
.nav-item { border: 0; border-radius: 10px; background: transparent; color: var(--muted); padding: 12px 14px; text-align: left; font-weight: 650; }
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item.active { color: var(--accent); background: rgba(84, 226, 166, .09); box-shadow: inset 3px 0 var(--accent); }
.sidebar-foot { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
main { padding: 42px clamp(24px, 5vw, 70px) 70px; overflow: hidden; }
header { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 30px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 19px; letter-spacing: -.02em; }
.eyebrow { margin-bottom: 7px; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: 10px; font-weight: 800; }
.header-actions { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
button.primary, button.secondary { border-radius: 9px; padding: 9px 13px; font-weight: 750; }
button.primary { border: 1px solid var(--accent); color: #052218; background: var(--accent); }
button.primary:hover { filter: brightness(1.07); }
button.secondary { border: 1px solid var(--line); color: var(--text); background: var(--surface); }
button.secondary:hover { border-color: #3c5550; background: var(--surface-2); }
.panel-actions { display: flex; align-items: center; gap: 8px; }
.button-link { display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; padding: 9px 13px; font-weight: 750; text-decoration: none; }
.button-link.primary { border: 1px solid var(--accent); color: #052218; background: var(--accent); }
.button-link.secondary { border: 1px solid var(--line); color: var(--text); background: var(--surface); }
.button-link:hover { filter: brightness(1.08); }
.view { display: none; }
.view.active { display: block; animation: reveal .24s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric, .panel { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(20, 33, 30, .98), rgba(13, 23, 21, .98)); box-shadow: var(--shadow); }
.metric { min-height: 132px; padding: 20px; position: relative; overflow: hidden; }
.metric::after { content: ""; position: absolute; right: -35px; bottom: -50px; width: 110px; height: 110px; border: 18px solid rgba(84, 226, 166, .035); border-radius: 50%; }
.metric p { color: var(--muted); font-size: 12px; }
.metric strong { display: block; font-size: 30px; letter-spacing: -.04em; }
.metric small { color: var(--accent); font-size: 11px; }
.grid-two { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; }
.panel { padding: 22px; }
.panel-title { display: flex; justify-content: space-between; align-items: start; margin-bottom: 19px; }
.panel-title.split { align-items: center; }
.activity-list { display: grid; }
.activity-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.activity-row:first-child { border-top: 0; }
.activity-row time, .activity-row small { color: var(--muted); font-size: 11px; }
.activity-row strong { font-size: 13px; }
.posture-item { display: flex; gap: 12px; padding: 15px 0; border-top: 1px solid var(--line); }
.posture-item:first-of-type { border-top: 0; }
.posture-item strong { font-size: 13px; }
.posture-item p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.posture-icon { flex: 0 0 auto; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 900; font-size: 12px; }
.posture-icon.good { color: var(--accent); background: rgba(84, 226, 166, .1); }
.posture-icon.warn { color: var(--warning); background: rgba(246, 195, 91, .1); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; text-align: left; font-weight: 750; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); }
td { font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.file-path { display: block; max-width: 430px; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 800; }
.badge.online, .badge.info { color: var(--accent); background: rgba(84, 226, 166, .1); }
.badge.offline { color: var(--muted); background: rgba(145, 162, 158, .1); }
.badge.warning { color: var(--warning); background: rgba(246, 195, 91, .1); }
.badge.error { color: var(--danger); background: rgba(255, 120, 111, .1); }
.search { display: flex; gap: 8px; }
input, textarea { border: 1px solid var(--line); border-radius: 9px; background: #091311; color: var(--text); outline: none; }
input { padding: 9px 12px; }
textarea { width: 100%; resize: vertical; padding: 13px; line-height: 1.7; }
input:focus, textarea:focus { border-color: var(--accent-deep); box-shadow: 0 0 0 3px rgba(84, 226, 166, .06); }
.muted { color: var(--muted); font-size: 12px; line-height: 1.6; }
.policy-grid, .user-grid { grid-template-columns: 1fr 1fr; }
.policy-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding-top: 16px; color: var(--muted); font-size: 11px; }
.stacked-panel { margin-top: 16px; }
.stack-form { display: grid; gap: 14px; }
.stack-form label, #enrollment-form label, #password-form label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }
.stack-form select { border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; color: var(--text); background: #091311; }
.user-role { min-width: 126px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; color: var(--text); background: #091311; }
#enrollment-request, #enrollment-result { display: grid; gap: 13px; }
#enrollment-result.hidden, .permission-control.hidden { display: none; }
.compact-steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(3, 8, 7, .8); backdrop-filter: blur(12px); }
.modal-backdrop.hidden, .toast.hidden { display: none; }
.modal { width: min(100%, 480px); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 30px 100px rgba(0, 0, 0, .55); padding: 28px; }
.login-card { width: min(100%, 380px); }
.download-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; }
.download-card { width: min(100%, 700px); padding: clamp(26px, 6vw, 52px); border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(20, 33, 30, .98), rgba(13, 23, 21, .98)); box-shadow: var(--shadow); }
.download-brand { padding: 0; }
.download-brand h1 { font-size: clamp(28px, 6vw, 44px); }
.download-lead { margin: 24px 0; color: var(--muted); line-height: 1.7; }
.download-link { display: flex; justify-content: center; width: 100%; margin-bottom: 12px; border: 1px solid var(--accent); border-radius: 12px; padding: 15px 18px; color: #052218; background: var(--accent); font-weight: 850; text-decoration: none; }
.install-steps { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.install-steps ol { padding-left: 22px; color: var(--muted); line-height: 2; }
code { border-radius: 5px; padding: 2px 5px; color: var(--accent); background: #091311; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.checksum-box { display: grid; gap: 8px; margin-top: 24px; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.checksum-box code { overflow-wrap: anywhere; }
.checksum-box a, .back-link { color: var(--accent); font-size: 12px; }
.notice { margin-top: 20px; border-left: 3px solid var(--warning); padding: 10px 14px; color: var(--muted); background: rgba(246, 195, 91, .06); font-size: 12px; line-height: 1.65; }
.login-card label { display: block; margin: 22px 0 7px; color: var(--muted); font-size: 11px; }
.login-card input, .login-card button { width: 100%; }
.login-card button { margin-top: 10px; }
.form-error { min-height: 18px; margin: 8px 0 0; color: var(--danger); font-size: 11px; }
.versions-card { width: min(100%, 660px); max-height: 80vh; overflow: auto; }
.versions-list { display: grid; gap: 9px; }
.version-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.version-row strong, .version-row small { display: block; }
.version-row small { margin-top: 4px; color: var(--muted); }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 28px; }
.toast { position: fixed; z-index: 30; right: 26px; bottom: 26px; max-width: 380px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); box-shadow: var(--shadow); padding: 13px 16px; font-size: 12px; }
.empty { padding: 34px 12px; color: var(--muted); text-align: center; }

@media (max-width: 1050px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-two { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; padding: 18px; }
  .brand { padding-bottom: 14px; }
  nav { display: flex; overflow-x: auto; }
  .nav-item { white-space: nowrap; }
  .sidebar-foot { display: none; }
  main { padding: 26px 16px 50px; }
  header { align-items: start; }
  .header-actions span, #logout-button { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 112px; }
  .activity-row { grid-template-columns: 88px 1fr; }
  .activity-row small { display: none; }
  .panel-title.split { align-items: start; gap: 14px; flex-direction: column; }
  .search { width: 100%; }
  .search input { min-width: 0; flex: 1; }
}
