:root { --bg: #0d1117; --card: #161b22; --card2: #1c2330; --line: #30363d; --fg: #e6edf3; --muted: #9aa4ae; --accent: #2f81f7;
  --ok: #2ea043; --warn: #d29922; --bad: #da3633; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: #79c0ff; }
button, .btn { font: inherit; color: var(--fg); background: #2d333b; border: 1px solid #444c56; border-radius: 8px; padding: 8px 14px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; }
button:hover, .btn:hover { border-color: #6e7681; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
button.danger { background: transparent; border-color: var(--bad); color: #ff7b72; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { font: inherit; color: var(--fg); background: #0d1117; border: 1px solid #444c56; border-radius: 8px; padding: 9px 11px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: #ff7b72; font-size: 14px; min-height: 20px; margin-top: 8px; white-space: pre-wrap; }
.okmsg { color: #56d364; font-size: 14px; margin-top: 8px; }
.hidden, [hidden] { display: none !important; }

/* ---- login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .box { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.login h1 { margin: 0 0 4px; font-size: 22px; }
.login .tabs { display: flex; gap: 6px; margin: 16px 0 4px; }
.login .tabs button { flex: 1; }
.login .tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.login form button[type=submit] { width: 100%; margin-top: 18px; }

/* ---- app */
header.top { position: sticky; top: 0; z-index: 20; background: #1f2328; border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; max-width: 1100px; margin: 0 auto; }
.brand { font-weight: 800; font-size: 18px; letter-spacing: .02em; }
.brand small { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 6px; }
.topbar .sp { flex: 1; }
.bell { position: relative; min-width: 44px; }
.badge { position: absolute; top: -6px; right: -6px; background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700;
  padding: 1px 6px; min-width: 18px; text-align: center; }
nav.tabs { display: flex; gap: 4px; padding: 0 12px 8px; max-width: 1100px; margin: 0 auto; overflow-x: auto; }
nav.tabs a { color: var(--fg); text-decoration: none; padding: 8px 12px; border-radius: 8px; white-space: nowrap; font-size: 15px; }
nav.tabs a.on { background: #30363d; font-weight: 600; }
nav.tabs a .n { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
main.page { max-width: 1100px; margin: 0 auto; padding: 16px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 10px; }
h2:first-child { margin-top: 4px; }
.card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 10px; color: inherit; text-decoration: none; }
a.card:hover { border-color: #6e7681; }
.card .main { flex: 1; min-width: 0; }
.card .t { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta { color: var(--muted); font-size: 13px; }
.card .note { color: #c9d1d9; font-size: 14px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.st-pending, .st-in_review { background: #9e6a0333; color: var(--warn); }
.st-changes { background: #da363333; color: #ff7b72; }
.st-approved { background: #2ea04333; color: #56d364; }
.st-uploading { background: #30363d; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #30363d; }
.chip.approved { background: #2ea04333; color: #56d364; }
.chip.changes { background: #da363333; color: #ff7b72; }
.empty { color: var(--muted); padding: 10px 2px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.people label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 10px; background: #0d1117; border: 1px solid #444c56;
  border-radius: 8px; color: var(--fg); font-size: 15px; cursor: pointer; }
.people input { width: auto; }
.people label.on { border-color: var(--accent); background: #1f6feb22; }
.drop { border: 2px dashed #444c56; border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--accent); color: var(--fg); }
.flist { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.flist li { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.flist .k { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: #30363d; color: var(--muted); }
.flist .k.v { background: #1f6feb33; color: #79c0ff; }
.progress { height: 10px; background: #30363d; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.list td { padding: 8px; border-bottom: 1px solid #21262d; vertical-align: middle; }
table.list td .row { gap: 6px; }
table.list button { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.wrapx { overflow-x: auto; }
.round { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.round:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.rv { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; font-size: 14px; }
.rv .c { color: #c9d1d9; white-space: pre-wrap; }
.dd { position: absolute; right: 12px; top: 58px; width: min(420px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .55); z-index: 30; padding: 6px; }
.dd .it { display: block; padding: 10px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 14px; }
.dd .it:hover { background: #21262d; }
.dd .it.unread { background: #1f6feb1f; }
.dd .it .when { color: var(--muted); font-size: 12px; }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal .box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; width: min(520px, 100%); }
.code { font: 700 26px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .08em; background: #0d1117; border: 1px solid #444c56;
  border-radius: 10px; padding: 12px; text-align: center; margin: 10px 0; user-select: all; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #000d; color: #fff; padding: 10px 18px;
  border-radius: 10px; z-index: 60; font-weight: 600; max-width: 90vw; text-align: center; }
