:root {
  --bg: #f5f6f8; --panel: #fff; --line: #e3e6eb; --text: #1d2330; --muted: #6b7385;
  --accent: #2f5bea; --accent-weak: #e8eefd; --danger: #c93838; --ok: #1f8a4c; --warn: #b7791f;
  --radius: 8px; font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 12px; color: var(--text); }
button:hover { border-color: #c5cad3; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.danger { color: var(--danger); }
button.link { border: 0; background: none; color: var(--accent); padding: 2px 4px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: #fff; width: 100%; }
label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 12px; }
h1 { font-size: 20px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 0 0 12px; } h3 { font-size: 14px; margin: 16px 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; }
.spacer { flex: 1; }

/* 로그인 */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; flex: none; }
.brand .sub { display: block; font-size: 11px; font-weight: 400; color: #8b93a7; }
.notice { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--accent-weak); color: var(--text); }
.notice.WARN { background: #fff3e0; color: #8a5300; }
.menu-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid #f0f1f4; }
.auth-card button.primary { width: 100%; margin-top: 18px; padding: 9px; }
.hint { background: var(--accent-weak); border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.6; margin-top: 16px; }

/* 틀 */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: #141a26; color: #cfd5e2; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.side .brand { color: #fff; padding: 4px 8px 14px; }
.side .sec { font-size: 11px; color: #7f889b; padding: 14px 10px 4px; letter-spacing: .04em; }
.side a { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 6px; color: inherit; text-decoration: none; cursor: pointer; }
.side a:hover { background: #222a3a; } .side a.on { background: #2b3550; color: #fff; }
.side .me { margin-top: auto; border-top: 1px solid #263045; padding: 12px 8px 0; font-size: 12px; }
.main { padding: 20px 28px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel.pad { padding: 16px 18px; }

/* 탐색기 */
.crumbs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; font-size: 15px; }
.crumbs a { color: var(--accent); cursor: pointer; } .crumbs .sep { color: #b8bec9; }
.toolbar { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); align-items: center; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; }
td { padding: 8px 12px; border-bottom: 1px solid #f0f1f4; vertical-align: middle; }
tr:hover td { background: #fafbff; }
.name { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.name .ic { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.drop { outline: 2px dashed var(--accent); outline-offset: -6px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #eef0f4; color: #4a5263; white-space: nowrap; }
.badge.PUBLIC { background: #e7f6ee; color: var(--ok); } .badge.INTERNAL { background: #eef0f4; }
.badge.CONFIDENTIAL { background: #fff3e0; color: var(--warn); } .badge.SECRET { background: #fde8e8; color: var(--danger); }
.badge.OK { background: #e7f6ee; color: var(--ok); } .badge.DENIED, .badge.FAILED { background: #fde8e8; color: var(--danger); }
.perms { display: flex; gap: 3px; flex-wrap: wrap; } .perms .badge { font-size: 10px; }
.actions { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }

/* 창 */
.overlay { position: fixed; inset: 0; background: rgba(15, 20, 30, .45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 12px; width: min(720px, 100%); max-height: 92vh; overflow: auto; padding: 20px 22px; }
.modal.wide { width: min(1100px, 100%); }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.viewer { background: #3b4150; border-radius: 8px; padding: 16px; text-align: center; min-height: 300px; }
.viewer img { max-width: 100%; box-shadow: 0 2px 10px rgba(0,0,0,.4); background: #fff; user-select: none; -webkit-user-drag: none; }
.acl-row { display: grid; grid-template-columns: 110px 1fr 140px 90px 80px 32px; gap: 6px; align-items: center; margin-bottom: 6px; }
.chk { display: inline-flex; gap: 4px; align-items: center; margin-right: 10px; font-size: 12px; color: var(--text); }
.chk input { width: auto; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 12px; align-items: center; }
pre.detail { margin: 0; white-space: pre-wrap; word-break: break-all; font-size: 11px; color: #4a5263; max-width: 380px; }
#toast { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 99; }
#toast div { background: #1d2330; color: #fff; padding: 10px 14px; border-radius: 8px; max-width: 360px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
#toast div.err { background: var(--danger); }
.qr svg { width: 200px; height: 200px; }
.codes { font-family: ui-monospace, Consolas, monospace; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; background: #f5f6f8; padding: 12px; border-radius: 8px; }
.pill-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.pill-tabs button.on { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); }

mark { background: #fff1a8; color: inherit; padding: 0 1px; border-radius: 2px; }
