/* NasPark — LifePark·FilePark 과 같은 배경·같은 틀, 강조색은 NasPark 것(파랑 #4f8cff, 아이콘 정하면 맞춘다).
   ★관리 도구라 '꺼짐·금지' 같은 상태색이 눈에 먼저 들어와야 한다 — 강조색은 차분하게 둔다. */
:root {
  --bg: #0b0a12;
  --text: #eceaf3;
  --muted: #bcb8cd;
  --line: rgba(255,255,255,.10);
  --glass: rgba(255,255,255,.055);
  --card: rgba(14,12,22,.62);
  --primary: #4f8cff;
  --primary-dark: #2f5fd0;
  --primary-soft: rgba(79,140,255,.20);
  --error: #ff8a8a;
  --ok: #6adc91;
  --warn: #ffc56b;
  --list-w: 340px;
}
* { box-sizing: border-box; }
/* hidden 이 클래스 규칙(display:flex 등)에 지지 않게 (FilePark 에서 겪은 것) */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
  overflow: hidden;
}

.aurora { position: fixed; inset: -20% -10%; z-index: -2; filter: blur(72px); opacity: .36; pointer-events: none; }
.aurora span { position: absolute; display: block; border-radius: 50%; mix-blend-mode: screen; }
.aurora span:nth-child(1) { width: 46vw; height: 46vw; left: 2%;  top: 0%;    background: #2f6ff6; }
.aurora span:nth-child(2) { width: 38vw; height: 38vw; right: 4%; top: 10%;   background: #6a4cf0; }
.aurora span:nth-child(3) { width: 34vw; height: 34vw; left: 24%; bottom: 0%; background: #1f9fd6; }
.aurora span:nth-child(4) { width: 24vw; height: 24vw; right: 18%; bottom: 4%; background: #f0a63c; opacity: .55; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; background: rgba(9,8,14,.36); pointer-events: none; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
button:disabled { opacity: .6; cursor: default; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pad { padding: 14px; }
.center-text { text-align: center; }
.error { color: var(--error); font-size: 13px; margin: 0; }
.note { font-size: 12px; margin: 4px 0 0; text-align: center; }

.link-btn { padding: 6px 12px; border-radius: 999px; font-size: 13.5px; background: var(--glass); border: 1px solid var(--line); }
.link-btn:hover { background: rgba(255,255,255,.12); }
.icon-btn { width: 34px; height: 34px; flex: none; border-radius: 999px; color: var(--muted); font-size: 16px; }
.icon-btn:hover { background: var(--glass); color: var(--text); }
.primary {
  padding: 13px; border-radius: 999px; font-size: 15px; font-weight: 700;
  color: #fff; background: linear-gradient(100deg, var(--primary), var(--primary-dark));
}

/* ── 로그인 ── */
.center-view { display: flex; align-items: center; justify-content: center; height: 100%; padding: 24px 16px; overflow-y: auto; }
.card {
  width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px;
  padding: 26px; border-radius: 20px;
  background: rgba(16,14,24,.86); border: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.badge {
  width: 62px; height: 62px; align-self: center; display: grid; place-items: center;
  font-size: 30px; border-radius: 20px;
  background: linear-gradient(140deg, var(--primary), var(--primary-dark));
}
.badge-img { align-self: center; border-radius: 16px; }
.logo-img { flex: none; border-radius: 8px; }
.brand { margin: 8px 0 0; font-size: 30px; text-align: center; }
.sub { margin: 0 0 8px; font-size: 13px; letter-spacing: .04em; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
/* ★16px 미만이면 아이폰이 입력칸을 누를 때 화면을 확대한다 */
.field input, .search {
  padding: 12px 14px; border-radius: 12px; font-size: 16px;
  background: var(--glass); border: 1px solid var(--line); color: var(--text); outline: none;
}
.field input:focus, .search:focus { border-color: var(--primary); }

/* ── 관리 화면 ── */
.main { display: flex; flex-direction: column; height: 100%; }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); background: rgba(12,10,20,.55); backdrop-filter: blur(14px);
}
.logo { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; font-size: 16px;
  background: linear-gradient(140deg, var(--primary), var(--primary-dark)); }
.title { font-size: 16px; }
.who { font-size: 13px; }
.idle { font-size: 12.5px; font-variant-numeric: tabular-nums; padding: 4px 8px; border-radius: 999px; background: var(--glass); }
.idle.warn { color: var(--warn); }

.body { flex: 1; display: flex; min-height: 0; }

.list-pane {
  width: var(--list-w); flex: none; display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line); background: var(--card);
}
.list-tools { display: flex; gap: 6px; align-items: center; padding: 12px 12px 6px; }
.search { flex: 1; min-width: 0; padding: 9px 12px; }
.list-filter { display: flex; align-items: center; gap: 6px; padding: 4px 12px 8px; }
.chip { padding: 4px 11px; border-radius: 999px; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); }
.chip.on { color: #fff; background: var(--primary-soft); border-color: var(--primary); }

/* 보기 방식 (이름순 / 그룹별) */
.list-meta { display: flex; align-items: center; gap: 8px; padding: 0 12px 8px; }
.view-toggle { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); }
.view-toggle button { padding: 3px 12px; border-radius: 999px; font-size: 12.5px; color: var(--muted); }
.view-toggle button.on { color: #fff; background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.view-toggle button:disabled { opacity: .4; }

/* 그룹별 보기 — 머리줄 + 들여 쓴 계정 */
.group-head {
  display: flex; align-items: baseline; gap: 6px; margin: 8px 0 2px; padding: 6px 10px;
  border-radius: 10px; cursor: pointer; font-size: 13.5px; user-select: none;
}
.group-head:first-child { margin-top: 0; }
.group-head:hover { background: var(--glass); }
.group-head .fold { width: 12px; color: var(--muted); font-size: 11px; }
.group-head .g-count { padding: 0 7px; border-radius: 999px; font-size: 11.5px; color: var(--muted); background: rgba(255,255,255,.07); }
.group-head .g-desc { font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; flex: 1; }
.user-row.in-group { margin-left: 12px; }
.row-groups { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.row-groups .tag { margin-left: 0; }
.tag.grp { background: rgba(255,255,255,.07); color: var(--muted); font-weight: 500; }

.user-list { list-style: none; margin: 0; padding: 0 6px 12px; overflow-y: auto; flex: 1; min-height: 0; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; cursor: pointer; }
.user-row:hover { background: var(--glass); }
.user-row.sel { background: var(--primary-soft); }
/* 꺼진 계정 — 점 색만으로는 안 보인다(폰 화면에서 확인). 줄 전체를 흐리게 */
.user-row.off { opacity: .55; }
.user-row.off .avatar { background: rgba(255,255,255,.14); }
.user-row.off .row-name { color: var(--muted); }
.row-main { flex: 1; min-width: 0; }
.row-name { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.row-sub { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 50%;
  font-weight: 700; font-size: 19px; background: linear-gradient(140deg, #5b6bd8, #3b3f8f); }
.avatar.sm { width: 34px; height: 34px; font-size: 14px; }

.dot { width: 9px; height: 9px; flex: none; border-radius: 50%; }
.dot.on { background: var(--ok); }
.dot.off { background: rgba(255,255,255,.25); }

.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; vertical-align: middle; margin-left: 4px; }
.tag.me { background: var(--primary-soft); color: #cfe0ff; }
.tag.sys { background: rgba(255,255,255,.08); color: var(--muted); }
.tag.on { background: rgba(106,220,145,.16); color: var(--ok); margin-left: 0; }
.tag.off { background: rgba(255,255,255,.08); color: var(--muted); margin-left: 0; }
.tag.admin { background: rgba(255,197,107,.16); color: var(--warn); }

.detail-pane { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 24px 40px; }
.detail-empty { height: 100%; display: grid; place-items: center; font-size: 14px; }
.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.d-name { margin: 0 0 4px; font-size: 22px; word-break: break-all; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.back { display: none; }

.block { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; max-width: 760px; }
.block h3 { margin: 0 0 10px; font-size: 14px; }
.block p { margin: -4px 0 10px; }
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 8px 12px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

.group-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gchip { padding: 4px 10px; border-radius: 999px; font-size: 12.5px; color: var(--muted); border: 1px dashed var(--line); }
.gchip.member { color: var(--text); border-style: solid; border-color: var(--primary); background: var(--primary-soft); }

.perm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.perm-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 4px 6px 6px; border-bottom: 1px solid var(--line); }
.perm-table td { padding: 7px 6px; border-bottom: 1px solid rgba(255,255,255,.05); }
.perm { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.perm.rw { background: rgba(106,220,145,.16); color: var(--ok); }
.perm.ro { background: rgba(79,140,255,.18); color: #a9c6ff; }
.perm.deny { background: rgba(255,138,138,.16); color: var(--error); }
.perm.none { color: var(--muted); font-weight: 400; }
.perm-table tr.dim td:first-child { color: var(--muted); }
.perm-table .src { font-size: 12px; margin-left: 8px; }

/* ── 계정 만들기 ── */
.list-actions { padding: 0 12px 8px; }
.small-primary {
  width: 100%; padding: 9px 12px; border-radius: 12px; font-size: 14px; font-weight: 700;
  color: #fff; background: linear-gradient(100deg, var(--primary), var(--primary-dark));
}
.avatar.new { background: var(--primary-soft); color: #cfe0ff; border: 1px dashed var(--primary); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 14px; }
.req { color: var(--error); }
.hint { font-size: 12px; }
.hint.good { color: var(--ok); }
.hint.bad { color: var(--error); }
.pw-row { display: flex; gap: 6px; align-items: center; }
.pw-row input { flex: 1; min-width: 0; }
.row-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 8px; }
.check { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); transform: translateY(3px); }
.check .small { flex-basis: 100%; padding-left: 25px; margin-top: -2px; }
.check.danger > span:not(.small) { color: var(--warn); }
.check-list { display: flex; flex-direction: column; gap: 10px; }
.select {
  width: 100%; max-width: 420px; padding: 10px 12px; border-radius: 12px; font-size: 16px;
  background: #1a1726; border: 1px solid var(--line); color: var(--text);
}
.copy-info { margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.6;
  background: var(--glass); border: 1px solid var(--line); word-break: break-all; }
.copy-info b { color: var(--muted); font-weight: 600; }
.form-error { max-width: 760px; margin: 0 0 10px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; max-width: 760px; }
.form-actions .primary { padding: 11px 22px; }

/* ── 편집 ── */
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; max-width: 760px; }
.link-btn.danger { color: var(--error); }
.block h3 { display: flex; align-items: center; gap: 8px; }
.sec-edit { margin-left: auto; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  color: #cfe0ff; border: 1px solid rgba(79,140,255,.45); }
.sec-edit:hover { background: var(--primary-soft); }
.block:not(.editing) .edit-only { display: none !important; }
.block.editing .view-only, .block.editing .sec-edit { display: none !important; }
.block.editing { border-color: rgba(79,140,255,.55); }
.sec-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.sec-actions .error { font-size: 13px; }
.small-primary.auto { width: auto; padding: 7px 18px; }
.top-gap { margin-top: 12px; }
.perm-select { padding: 5px 8px; border-radius: 8px; font-size: 14px; background: #1a1726; color: var(--text); border: 1px solid var(--line); }
.perm-table tr.changed td { background: rgba(79,140,255,.08); }
.perm-table tr.changed td:first-child { box-shadow: inset 3px 0 0 var(--primary); }

.modal { position: fixed; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(5,4,10,.6); backdrop-filter: blur(4px); }
.modal-card { width: min(420px, 100%); }
.modal-title { margin: 0 0 4px; font-size: 16px; word-break: break-all; }

/* ── 지우기 ── */
.danger-title { color: var(--error); }
.warn-list { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.65; color: var(--muted); }
.warn-list b { color: var(--text); }
.del-hint { color: var(--text); padding: 1px 6px; border-radius: 6px; background: var(--glass); }
.danger-btn { background: linear-gradient(100deg, #e05a5a, #b33a3a); }
.danger-btn:disabled { background: rgba(255,255,255,.1); color: var(--muted); opacity: 1; }
.head-actions .link-btn:disabled { opacity: .45; }

/* ── 작업 기록 ── */
.log-search { width: 100%; max-width: 760px; margin-bottom: 10px; }
.log-list { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.log-row { padding: 9px 12px; border-radius: 12px; margin-bottom: 6px; background: var(--card); border: 1px solid var(--line); }
.log-row.bad { border-color: rgba(255,138,138,.35); }
.log-row.del { border-left: 3px solid var(--error); }
.log-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.log-target { padding: 1px 8px; border-radius: 999px; background: var(--glass); font-size: 13px; }
.log-time { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.log-sub { font-size: 12.5px; margin-top: 3px; word-break: break-all; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
  padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px);
  background: rgba(22,20,32,.95); border: 1px solid var(--line);
}

/* ── 폰: 목록 ↔ 상세 한 장씩 ── */
@media (max-width: 760px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .who { display: none; }
  .list-pane { width: 100%; border-right: none; }
  .detail-pane { display: none; padding: 14px 16px 32px; }
  body.show-detail .list-pane { display: none; }
  body.show-detail .detail-pane { display: block; }
  .back { display: grid; place-items: center; }
  .detail-head { gap: 10px; }
  .avatar { width: 40px; height: 40px; font-size: 17px; }
  .kv { grid-template-columns: 70px 1fr; }
  .perm-table .src { display: block; margin: 3px 0 0; }
}
