/* Rewired Hub — mobile-first. Brand: sky blue #009BDC on near-black. */
:root {
  --blue: #009bdc;
  --blue-dim: #0a3d55;
  --bg: #0b0d10;
  --card: #15191e;
  --card-2: #1c2128;
  --line: #262c35;
  --text: #f3f5f7;
  --muted: #9aa4b0;
  --good: #2ecc71;
  --warn: #f5a623;
  --bad: #ff5c5c;
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  padding-top: calc(56px + var(--safe-top));
  padding-bottom: calc(68px + var(--safe-bottom));
}
a { color: var(--blue); text-decoration: none; }
button { font: inherit; }

/* Top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: calc(56px + var(--safe-top)); padding: var(--safe-top) 12px 0;
  display: flex; align-items: center; gap: 8px;
  background: rgba(11, 13, 16, .92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { background: none; border: 0; color: var(--blue); font-size: 34px; line-height: 1; padding: 0 8px 4px 0; }
.topbar .bell { font-size: 20px; padding: 6px; position: relative; }
.topbar .bell[data-count]::after {
  content: attr(data-count); position: absolute; top: 0; right: -2px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 9px; padding: 1px 5px;
}

/* Bottom tabs */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: var(--safe-bottom);
  background: rgba(11, 13, 16, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; color: var(--muted); font-size: 11px; font-weight: 600; }
.tabbar a span { font-size: 20px; line-height: 1.1; }
.tabbar a.on { color: var(--blue); }

main { padding: 14px 14px 24px; max-width: 640px; margin: 0 auto; }
.loading, .empty { color: var(--muted); text-align: center; padding: 40px 10px; }
.error { background: #3a1416; border: 1px solid #6b2226; color: #ffd6d6; border-radius: var(--radius); padding: 14px; }

h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 4px 8px; font-weight: 700; }
h2:first-child { margin-top: 4px; }
.hello { font-size: 24px; font-weight: 800; margin: 2px 4px 2px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 4px 10px; }

/* Cards & lists */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.row { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border-top: 1px solid var(--line); color: var(--text); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev { color: var(--muted); font-size: 20px; }
.time { min-width: 52px; text-align: center; font-weight: 800; font-size: 14px; color: var(--blue); line-height: 1.15; }
.time small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.pill.blue { background: var(--blue-dim); color: #bfe9ff; border-color: #11597c; }
.pill.good { background: #123a24; color: #a6f0c4; border-color: #1d5c39; }
.pill.warn { background: #3d2c0b; color: #ffd98f; border-color: #6a4b12; }

/* Banners */
.banner { display: flex; align-items: center; gap: 12px; background: linear-gradient(90deg, #00739f, var(--blue)); color: #fff; border-radius: var(--radius); padding: 13px 14px; margin-bottom: 10px; font-weight: 650; }
.banner .n { background: rgba(0,0,0,.25); border-radius: 10px; min-width: 34px; text-align: center; padding: 4px 6px; font-weight: 800; }
.banner .grow { flex: 1; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-size: 22px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 12.5px; }
.stat.money .v { color: var(--good); }

/* Job view */
.job-head .id { color: var(--muted); font-size: 13px; font-weight: 700; }
.job-head .title { font-size: 20px; font-weight: 800; margin: 4px 0 8px; line-height: 1.25; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; }
.btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); font-weight: 700; font-size: 13px; text-align: center; padding: 8px; cursor: pointer; }
.btn span { font-size: 20px; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.wide { flex-direction: row; gap: 8px; width: 100%; min-height: 50px; font-size: 15px; }
.btn[disabled], .btn.off { opacity: .4; pointer-events: none; }
.kv { display: grid; grid-template-columns: 100px 1fr; gap: 6px 10px; font-size: 14.5px; }
.kv .k { color: var(--muted); }
.scope { white-space: pre-wrap; font-size: 14.5px; line-height: 1.5; }
.scope.clamp { max-height: 180px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.more { background: none; border: 0; color: var(--blue); font-weight: 700; padding: 6px 0 0; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos .ph { aspect-ratio: 1; border-radius: 10px; background: var(--card-2) center/cover no-repeat; border: 1px solid var(--line); }
.note { border-top: 1px solid var(--line); padding: 10px 0; font-size: 14px; }
.note:first-child { border-top: 0; padding-top: 0; }
.note .meta { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.money-row { display: flex; justify-content: space-between; font-size: 15px; padding: 4px 0; }
.money-row b { color: var(--good); }

/* Forms */
.field { display: block; margin-bottom: 12px; }
.field span { display: block; color: var(--muted); font-size: 13px; margin: 0 2px 6px; font-weight: 600; }
input[type=email], input[type=password], input[type=text], input[type=search], input[inputmode=numeric] {
  width: 100%; font: inherit; font-size: 17px; color: var(--text); background: var(--card-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; outline: none;
}
input:focus { border-color: var(--blue); }
input.code { letter-spacing: .5em; text-align: center; font-size: 26px; font-weight: 800; }
.search { position: sticky; top: calc(56px + var(--safe-top)); background: var(--bg); padding: 2px 0 10px; z-index: 5; }
.seg { display: flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin-bottom: 10px; }
.seg button { flex: 1; border: 0; background: none; color: var(--muted); font-weight: 700; padding: 9px 6px; border-radius: 9px; font-size: 14px; }
.seg button.on { background: var(--blue); color: #fff; }

.login { max-width: 380px; margin: 6vh auto 0; }
.login .logo { width: 190px; height: auto; display: block; margin: 0 auto 18px; }
.login h1 { text-align: center; margin: 0 0 4px; font-size: 26px; }
.login p { text-align: center; color: var(--muted); margin: 0 0 22px; }
.link { background: none; border: 0; color: var(--blue); font-weight: 650; padding: 12px; width: 100%; }

.menu-group { margin-bottom: 6px; }
.soon { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + var(--safe-bottom)); background: #222a33; color: #fff; padding: 11px 16px; border-radius: 12px; z-index: 50; font-size: 14px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.4); max-width: 90vw; }

.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 100; display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: 100%; }
.viewer button { position: absolute; top: calc(10px + var(--safe-top)); right: 12px; background: rgba(255,255,255,.15); border: 0; color: #fff; font-size: 22px; width: 42px; height: 42px; border-radius: 21px; }

.install { background: var(--card-2); border: 1px dashed #335; border-radius: var(--radius); padding: 12px 14px; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.install b { color: var(--text); }
.foot { color: var(--muted); font-size: 12px; text-align: center; margin-top: 18px; }
