:root {
  --bg: #f4f6f9; --card: #fff; --ink: #1c2430; --muted: #6b7686; --line: #e3e7ee;
  --brand: #1f6feb; --brand-ink: #fff;
  --ok: #1a7f4b; --ok-bg: #e3f5ea; --warn: #9a6200; --warn-bg: #fff3d6;
  --bad: #b42318; --bad-bg: #fde7e5; --off: #5b6472; --off-bg: #eceff3;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 8px 0 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 18px; margin: 30px 0 10px; }
h3 { font-size: 16px; margin: 0 0 12px; }
code { background: var(--off-bg); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.r { text-align: right; }
.dim { opacity: .55; }
.clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Header */
.top { background: #0f1b2d; color: #c9d4e3; }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 58px; }
.brand { color: #fff; font-weight: 700; font-size: 17px; }

.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { color: #c9d4e3; padding: 7px 12px; border-radius: 6px; }
.top nav a.on, .top nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.me { font-size: 13px; }
.me a { color: #9cc7ff; }
main.wrap { padding-top: 22px; padding-bottom: 40px; }
.foot { color: var(--muted); font-size: 12px; padding-bottom: 30px; }
.crumbs { margin: 0; font-size: 13px; color: var(--muted); }

/* Cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow-x: auto; }
.card.highlight { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
.card.empty { text-align: center; padding: 40px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.grid2 .actions, .grid3 .actions { grid-column: 1 / -1; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-head h1, .row-head h2 { margin-bottom: 10px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; border-top: 3px solid var(--line); }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.ok { border-top-color: var(--ok); }
.stat.warning { border-top-color: #e3a008; }
.stat.failed { border-top-color: var(--bad); }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.r, .tbl td.r { text-align: right; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--off-bg); color: var(--off); white-space: nowrap; }
.badge-ok, .badge-success { background: var(--ok-bg); color: var(--ok); }
.badge-warning, .badge-new, .badge-running { background: var(--warn-bg); color: var(--warn); }
.badge-failed { background: var(--bad-bg); color: var(--bad); }
.badge-offline { background: var(--off-bg); color: var(--off); }

/* Forms */
label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
label .muted { font-weight: 400; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit; font-weight: 400;
  border: 1px solid #c8d0db; border-radius: 6px; background: #fff; color: var(--ink);
}
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31,111,235,.35); border-color: var(--brand); }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
label.check input { margin-top: 4px; }
label.warn { color: var(--warn); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input { width: auto; flex: 1; margin: 0; }
.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; border: 1px solid #c8d0db; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: #f1f4f8; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: #195ac2; }
.btn.danger { color: var(--bad); border-color: #f0b4ae; }
.btn.small { padding: 4px 10px; font-size: 13px; }

/* Misc */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--ok-bg); color: var(--ok); }
.flash-err { background: var(--bad-bg); color: var(--bad); }
.flash a { color: inherit; text-decoration: underline; }
.code { background: #0f1b2d; color: #d6e2f0; padding: 14px; border-radius: 8px; overflow-x: auto; font: 13px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.code.log { max-height: 600px; overflow-y: auto; }
.bar { height: 4px; background: var(--off-bg); border-radius: 2px; margin-top: 5px; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 2px; }
.bar i.hot { background: var(--bad); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0 0 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.login { max-width: 400px; margin: 60px auto; }
.login h1 { justify-content: center; }
.login p { text-align: center; }

@media (max-width: 800px) {
  .cols, .grid2, .grid3 { grid-template-columns: 1fr; }
  .top .wrap { height: auto; flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .top nav { order: 3; flex-basis: 100%; overflow-x: auto; }
}

/* ZebraBackup brand */
.brand { display: inline-flex; align-items: center; gap: 9px; letter-spacing: -.01em; }
svg.logo { display: inline-block; flex: none; }
.login h1 { gap: 12px; }
.foot a { color: var(--muted); text-decoration: underline; }

/* Live backup progress */
.live { border-color: #b9d3fb; }
.live-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.live-head b { font-size: 17px; }
.live-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }
.live-meta .clip { max-width: 60%; }
.pbar { height: 10px; background: var(--off-bg); border-radius: 99px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .8s ease; }
.pbar-wait i { width: 100%; background: repeating-linear-gradient(-45deg, #0f1b2d 0 8px, #fff 8px 16px); opacity: .35; animation: zb-stripes 1s linear infinite; background-size: 22.6px 22.6px; }
@keyframes zb-stripes { to { background-position: 22.6px 0; } }
.live-mini:empty { display: none; }
.live-mini { margin-top: 6px; min-width: 120px; }
.live-mini .pbar { height: 5px; margin-top: 3px; }
@media (prefers-reduced-motion: reduce) { .pbar i { transition: none; } .pbar-wait i { animation: none; } }
.badge-running { background: #e3edfd; color: #1f5fc4; }
.badge-cancelled { background: var(--off-bg); color: var(--off); }
.live-actions { display: flex; align-items: center; gap: 10px; }
.live-actions form { margin: 0; }
.flash-warn { background: var(--warn-bg); color: var(--warn); }
