:root { --bg:#0f1115; --card:#171a21; --card2:#1d212a; --line:#272b36; --fg:#e7e9ee; --muted:#9aa3b2; --accent:#4f7cff; --warn:#e0a83a; --bad:#ff7a7a; --good:#6fd38f; --s:#ff9f43; }
* { box-sizing:border-box; }
body { margin:0; font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Malgun Gothic",sans-serif; background:var(--bg); color:var(--fg); font-size:14px; }
.hidden { display:none !important; }
.muted { color:var(--muted); } .small { font-size:12px; }
a { color:var(--accent); }
h2 { font-size:19px; margin:0 0 14px; } h3 { font-size:15px; margin:18px 0 8px; }
label { display:block; font-size:12px; color:var(--muted); margin:10px 0 4px; }
input, select, textarea { padding:8px 9px; border-radius:7px; border:1px solid var(--line); background:#0d0f14; color:var(--fg); font-size:13px; font-family:inherit; }
input[type=checkbox] { width:16px; height:16px; }
button { padding:8px 13px; border:0; border-radius:7px; background:var(--accent); color:#fff; font-weight:600; font-size:13px; cursor:pointer; font-family:inherit; white-space:nowrap; }
button:disabled { opacity:.5; cursor:default; }
button.ghost { background:#2a2f3a; font-weight:500; } button.danger { background:#7a2b2b; }
button.sm { padding:5px 9px; font-size:12px; }
.icon-btn { background:transparent; color:var(--fg); font-size:18px; padding:4px 8px; }
.msg { margin-top:10px; font-size:13px; color:var(--bad); min-height:18px; }
.ok { color:var(--good); } .bad { color:var(--bad); } .warn { color:var(--warn); } .s-ex { color:var(--s); font-weight:700; }
.sublink { display:block; margin-top:14px; font-size:12px; color:var(--muted); cursor:pointer; }
/* login */
#login { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:16px; }
.box { width:100%; max-width:380px; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:24px; }
.box h1 { font-size:18px; margin:0 0 12px; } .box input { width:100%; } .box button { width:100%; margin-top:14px; }
/* layout */
#app { display:grid; grid-template-columns:210px 1fr; grid-template-rows:50px 1fr; grid-template-areas:"top top" "nav main"; min-height:100vh; }
header { grid-area:top; display:flex; align-items:center; gap:10px; padding:0 14px; border-bottom:1px solid var(--line); background:var(--card); position:sticky; top:0; z-index:5; }
header strong { flex:1; } header .who { font-size:12px; color:var(--muted); }
#btn-menu { display:none; }
nav { grid-area:nav; border-right:1px solid var(--line); padding:8px; background:var(--card); }
nav a { display:block; padding:9px 10px; border-radius:7px; color:var(--fg); text-decoration:none; cursor:pointer; margin-bottom:2px; }
nav a:hover { background:#1e222c; } nav a.active { background:var(--accent); color:#fff; }
nav .sep { font-size:11px; color:var(--muted); padding:10px 10px 4px; }
main { grid-area:main; padding:18px 20px 60px; min-width:0; }
/* parts */
.tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; margin-bottom:14px; }
.tile { background:var(--card); border:1px solid var(--line); border-radius:11px; padding:12px 14px; }
.tile .k { font-size:12px; color:var(--muted); } .tile .v { font-size:24px; font-weight:700; margin-top:4px; }
.tile.click { cursor:pointer; } .tile.click:hover { border-color:var(--s); }
.panel { background:var(--card); border:1px solid var(--line); border-radius:11px; padding:14px; margin-bottom:14px; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.bar { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end; margin-bottom:12px; }
.bar .f { display:flex; flex-direction:column; } .bar .f label { margin:0 0 3px; }
.banner { background:rgba(224,168,58,.12); border:1px solid var(--warn); color:var(--warn); padding:10px 12px; border-radius:9px; font-size:13px; margin-bottom:14px; }
.tablewrap { overflow-x:auto; border:1px solid var(--line); border-radius:9px; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th, td { text-align:left; padding:7px 8px; border-bottom:1px solid var(--line); white-space:nowrap; }
th { background:var(--card2); font-weight:600; color:var(--muted); font-size:12px; position:sticky; top:0; }
td.num, th.num { text-align:right; }
tbody tr:hover { background:#1a1e27; } tr.clickable { cursor:pointer; } tr.new { background:rgba(79,124,255,.14); }
.tag { display:inline-block; padding:1px 7px; border-radius:10px; font-size:11px; background:#2a2f3a; }
.tag.dup { background:#3a3020; color:var(--warn); } .tag.bl { background:#3a2020; color:var(--bad); } .tag.test { background:#203040; color:#8fc3ff; } .tag.s { background:#3d2a14; color:var(--s); } .tag.ok { background:#1d3326; color:var(--good); }
.pager { display:flex; gap:8px; align-items:center; margin-top:10px; }
.bulk { display:flex; flex-wrap:wrap; gap:8px; align-items:center; background:var(--card2); border:1px solid var(--line); border-radius:9px; padding:8px 10px; margin-bottom:10px; }
.tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; }
.tabs button { background:#2a2f3a; font-weight:500; } .tabs button.on { background:var(--accent); }
.hours { display:flex; align-items:flex-end; gap:3px; height:120px; padding-top:8px; }
.hours .h { flex:1; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; font-size:10px; color:var(--muted); min-width:0; }
.hours .b { width:100%; background:var(--accent); border-radius:3px 3px 0 0; min-height:1px; }
.hours .b.ex { background:var(--s); border-radius:0; }
.mono { font-family:ui-monospace,Consolas,monospace; }
.code-box { font:600 16px ui-monospace,Consolas,monospace; letter-spacing:2px; background:#0d0f14; padding:10px; border-radius:8px; word-break:break-all; }
.tree ul { list-style:none; padding-left:18px; margin:4px 0; } .tree li { margin:3px 0; }
/* modal / toast */
.modal { position:fixed; inset:0; background:rgba(0,0,0,.6); display:flex; align-items:flex-start; justify-content:center; padding:40px 12px; z-index:20; overflow:auto; }
.modal-box { position:relative; background:var(--card); border:1px solid var(--line); border-radius:13px; padding:20px; width:100%; max-width:640px; }
.modal-x { position:absolute; right:8px; top:8px; }
.kv { display:grid; grid-template-columns:120px 1fr; gap:6px 10px; font-size:13px; } .kv div:nth-child(odd) { color:var(--muted); }
.toast { position:fixed; right:16px; bottom:16px; background:#22324f; border:1px solid var(--accent); color:#fff; padding:10px 14px; border-radius:9px; z-index:30; max-width:360px; }
@media (max-width:860px) {
  #app { grid-template-columns:1fr; grid-template-areas:"top" "main"; }
  nav { display:none; position:fixed; top:50px; left:0; bottom:0; width:220px; z-index:10; overflow:auto; }
  nav.open { display:block; }
  #btn-menu { display:inline-block; }
  main { padding:14px 12px 60px; }
  .grid2 { grid-template-columns:1fr; }
}
