/* Портал Егорьевский 3а — mobile-first, крупно, по-русски */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue: #1a56db; --blue-dark: #1e429f;
  --green: #057a55; --green-bg: #def7ec;
  --amber: #b45309; --amber-bg: #fef3c7;
  --red: #c81e1e; --red-bg: #fde8e8;
  --gray: #6b7280; --line: #e5e7eb; --bg: #f3f4f6;
}
html { font-size: 17px; }
body {
  font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: #111827; min-height: 100vh;
}
#app { max-width: 560px; margin: 0 auto; padding: 12px 12px 84px; }
.loading { text-align: center; padding: 48px 0; color: var(--gray); }

h1 { font-size: 1.25rem; margin: 8px 0 4px; }
h2 { font-size: 1.05rem; margin: 16px 0 8px; }
.sub { color: var(--gray); font-size: .9rem; margin-bottom: 12px; }

.card {
  background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row + .row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.big { font-size: 1.5rem; font-weight: 600; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

.banner { border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; font-size: .95rem; line-height: 1.45; }
.banner.danger { background: var(--red-bg); color: var(--red); }
.banner.warning { background: var(--amber-bg); color: var(--amber); }
.banner.success { background: var(--green-bg); color: var(--green); }

.status { font-weight: 600; font-size: .92rem; white-space: nowrap; }
.status.ok { color: var(--green); }
.status.warn { color: var(--amber); }
.status.bad { color: var(--red); }
.status.mute { color: var(--gray); font-weight: 400; }

.chip { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 600; margin: 2px 4px 2px 0; }
.chip.ok { background: var(--green-bg); color: var(--green); }
.chip.warn { background: var(--amber-bg); color: var(--amber); }
.chip.bad { background: var(--red-bg); color: var(--red); }
.chip.mute { background: var(--bg); color: var(--gray); }

button, .btn {
  display: block; width: 100%; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--blue); color: #fff; font-size: 1.05rem; font-weight: 600;
  padding: 14px; margin-top: 10px; text-align: center; text-decoration: none;
  min-height: 48px;
}
button:active, .btn:active { background: var(--blue-dark); }
button.secondary, .btn.secondary { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
button.danger { background: var(--red); }
button.small { width: auto; display: inline-block; padding: 8px 14px; font-size: .9rem; margin: 4px 6px 0 0; min-height: 40px; }
button:disabled { opacity: .5; }

input, select {
  width: 100%; font-size: 1.15rem; padding: 12px 14px; margin-top: 6px;
  border: 1.5px solid #d1d5db; border-radius: 12px; background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
label { display: block; margin-top: 12px; font-size: .92rem; color: #374151; font-weight: 600; }
.hint { font-size: .85rem; color: var(--gray); margin-top: 6px; line-height: 1.4; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 1rem; }
.check input { width: 22px; height: 22px; margin: 0; }

.nav {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff;
  border-top: 1px solid var(--line); display: flex; z-index: 10;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav button {
  flex: 1; background: none; color: var(--gray); font-size: .75rem; font-weight: 600;
  border-radius: 0; margin: 0; padding: 8px 2px 10px; min-height: 54px;
}
.nav button .ico { display: block; font-size: 1.35rem; margin-bottom: 2px; }
.nav button.active { color: var(--blue); }
.nav button:active { background: var(--bg); }
.badge {
  display: inline-block; min-width: 20px; background: var(--red); color: #fff;
  font-size: .72rem; border-radius: 999px; padding: 1px 6px; margin-left: 4px;
}

.pin-row { display: flex; gap: 10px; justify-content: center; margin: 14px 0; }
.pin-row input { width: 56px; text-align: center; font-size: 1.6rem; padding: 12px 0; }

.list-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.tap { cursor: pointer; }
.tap:active { background: var(--bg); }

.seg { display: flex; background: #e5e7eb; border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; margin: 0; padding: 9px 4px; font-size: .88rem; border-radius: 10px; background: none; color: #374151; min-height: 40px; }
.seg button.active { background: #fff; color: var(--blue); box-shadow: 0 1px 2px rgba(0,0,0,.1); }

.metric { text-align: center; flex: 1; }
.metric .v { font-size: 1.15rem; font-weight: 700; }
.metric .l { font-size: .75rem; color: var(--gray); }

details { margin-top: 8px; }
summary { cursor: pointer; font-weight: 600; color: var(--blue); padding: 6px 0; }

.msg-ok, .msg-err { border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-size: .92rem; }
.msg-ok { background: var(--green-bg); color: var(--green); }
.msg-err { background: var(--red-bg); color: var(--red); }
