:root {
  --bg: #f4f5f7; --panel: #fff; --ink: #1d2433; --muted: #6b7280; --line: #e3e6eb;
  --brand: #0b5cad; --brand-ink: #fff; --ok: #15803d; --warn: #b45309; --err: #b91c1c; --info: #2563eb;
  --ok-bg: #e8f6ee; --warn-bg: #fdf3e2; --err-bg: #fdecec; --info-bg: #e9f0fe; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 12px; color: var(--ink); }
button:hover { border-color: #c4c9d2; }
button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.danger { color: var(--err); }
button.small { padding: 3px 8px; font-size: 12.5px; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%; background: #fff; color: var(--ink); }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 10px 0 4px; }
header { display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
header .logo { font-weight: 700; font-size: 16px; color: var(--brand); white-space: nowrap; }
.tabs { display: flex; gap: 4px; }
.tabs button { border-radius: 999px; }
.tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.health { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.ok::before { background: var(--ok); } .dot.bad::before { background: var(--err); } .dot.warn::before { background: var(--warn); }
main { display: grid; grid-template-columns: 1fr 340px; gap: 16px; padding: 16px 18px; }
@media (max-width: 1100px) { main { grid-template-columns: 1fr; } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; min-height: 118px; display: flex; flex-direction: column; gap: 5px; transition: box-shadow .15s; }
.card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.card.empty { align-items: center; justify-content: center; color: var(--muted); border-style: dashed; background: transparent; }
.card .top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.card .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .stats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.card .last { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #eef0f3; color: var(--ink); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err { background: var(--err-bg); color: var(--err); } .pill.info { background: var(--info-bg); color: var(--info); }
.spin { width: 10px; height: 10px; border: 2px solid var(--info); border-right-color: transparent; border-radius: 50%; display: inline-block; animation: s 0.8s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
aside.feed { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; height: calc(100vh - 100px); position: sticky; top: 76px; overflow: auto; }
aside.feed h3 { margin: 0 0 8px; font-size: 14px; }
.ev { font-size: 12.5px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ev .t { color: var(--muted); font-size: 11px; }
.ev.error { color: var(--err); } .ev.warning { color: var(--warn); }
.overlay { position: fixed; inset: 0; background: rgba(15,20,30,.4); display: none; z-index: 20; }
.overlay.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(980px, 100vw); background: var(--bg); z-index: 21; display: none; flex-direction: column; box-shadow: -4px 0 24px rgba(0,0,0,.15); }
.drawer.open { display: flex; }
.drawer .dh { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.drawer .dh h2 { margin: 0; font-size: 17px; flex: 1; }
.drawer .dtabs { display: flex; gap: 2px; padding: 0 18px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.drawer .dtabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 14px; background: none; white-space: nowrap; }
.drawer .dtabs button.active { border-bottom-color: var(--brand); color: var(--brand); font-weight: 600; }
.drawer .body { padding: 16px 18px 60px; overflow: auto; flex: 1; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 700px) { .row { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.hint { font-size: 12.5px; color: var(--muted); }
.notice { padding: 10px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 13px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); } .notice.err { background: var(--err-bg); color: var(--err); }
.notice.ok { background: var(--ok-bg); color: var(--ok); } .notice.info { background: var(--info-bg); color: var(--info); }
.drop { border: 2px dashed var(--line); border-radius: 8px; padding: 10px; text-align: center; color: var(--muted); font-size: 12.5px; }
.drop.over { border-color: var(--brand); background: var(--info-bg); }
.cat { margin-bottom: 14px; }
.cat h4 { margin: 0 0 6px; font-size: 13.5px; display: flex; justify-content: space-between; }
.file { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.file a { flex: 1; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file label { margin: 0; display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.file input[type=checkbox] { width: auto; }
.job { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.job .jh { display: flex; gap: 10px; align-items: flex-start; }
.job .jt { flex: 1; }
.job .jt b { font-size: 14.5px; }
.job ul { margin: 6px 0 0 18px; padding: 0; font-size: 12.5px; }
.score { font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 6px; background: #eef0f3; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.filters button.active { background: var(--ink); color: #fff; }
.modal { position: fixed; inset: 5vh 50% auto auto; transform: translateX(50%); width: min(900px, 94vw); max-height: 90vh; overflow: auto; background: var(--panel); border-radius: var(--radius); z-index: 31; display: none; padding: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal.open { display: block; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; display: none; }
.modal-bg.open { display: block; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 50; display: none; max-width: 90vw; }
.toast.err { background: var(--err); }
table.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
table.kv td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.kv td:first-child { color: var(--muted); width: 170px; }
pre.mail { white-space: pre-wrap; background: #f8f9fb; padding: 12px; border-radius: 8px; font: 13px/1.5 inherit; border: 1px solid var(--line); }
.login { max-width: 360px; margin: 12vh auto; background: var(--panel); padding: 28px; border-radius: 14px; border: 1px solid var(--line); }
.login h1 { font-size: 20px; margin: 0 0 4px; color: var(--brand); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.tile:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-1px); }
.tile .tl { font-size: 20px; font-weight: 700; color: var(--brand); }
.tile .ts { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tile .tn { display: flex; gap: 14px; margin-top: 12px; font-size: 13px; }
.tile .tn b { display: block; font-size: 20px; color: var(--ink); }
table.log { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 13px; }
table.log th { text-align: left; background: #f1f3f6; padding: 9px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
table.log td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: top; }
table.log tr:hover td { background: #fafbfc; }
table.log a { color: var(--ink); font-weight: 600; text-decoration: none; }
code.err { background: var(--err-bg); color: var(--err); padding: 2px 6px; border-radius: 5px; font-size: 12px; }
.banner { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; background: var(--err-bg); color: var(--err); }
