:root {
  --bg: #0c0b0a;
  --bg-2: #13110f;
  --card: #181614;
  --line: #2c2722;
  --text: #f4eee6;
  --muted: #9b9086;
  --gold: #e8a54b;
  --gold-2: #f3c27a;
  --ok: #86c07a;
  --warn: #e0b25a;
  --bad: #e36a58;
  --info: #79a8c8;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: Manrope, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: 0;
}
button, input, textarea { font: inherit; }
a { color: var(--gold); text-decoration: none; }
button { cursor: pointer; }

.login {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + var(--safe-t)) 20px calc(24px + var(--safe-b));
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(232, 165, 75, 0.16), transparent 60%),
    var(--bg);
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 22px 24px;
  box-shadow: var(--shadow);
}
.mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: #11100e; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--gold); font-weight: 800;
  letter-spacing: 0.04em;
}
.login h1 { margin: 16px 0 6px; font-size: 26px; letter-spacing: -0.03em; }
.login p { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 8px; }
input, textarea {
  width: 100%;
  background: #100e0c;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 14px;
  outline: none;
}
input:focus, textarea:focus { border-color: #6b542e; }
.field { margin-bottom: 14px; }
.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--gold);
  color: #1a1206;
  font-weight: 700;
  width: 100%;
}
.btn:disabled { opacity: 0.55; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: #3a1b16; color: #ffc2ba; }
.btn.small { width: auto; padding: 10px 12px; font-size: 13px; }
.err { color: #ffb4aa; font-size: 13px; min-height: 18px; margin: 4px 0 10px; }

.app {
  min-height: 100dvh;
  padding: calc(18px + var(--safe-t)) 16px calc(var(--nav-h) + var(--safe-b) + 18px);
}
.top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px;
}
.top h1 { margin: 0; font-size: 22px; letter-spacing: -0.03em; }
.sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.grid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px;
}
.stat b { display: block; font-size: 24px; letter-spacing: -0.04em; }
.stat span { color: var(--muted); font-size: 12px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px; margin-top: 12px;
}
.card h2 { margin: 0 0 10px; font-size: 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700;
  background: #241c14; color: var(--gold-2);
}
.pill.ok { background: #17301a; color: var(--ok); }
.pill.bad { background: #3a1b16; color: #ffb4aa; }
.pill.warn { background: #32280f; color: var(--warn); }
.pill.info { background: #152433; color: var(--info); }
.job {
  display: block; padding: 14px 0; border-bottom: 1px solid var(--line); color: inherit;
}
.job:last-child { border-bottom: 0; }
.job strong { display: block; font-size: 15px; margin-bottom: 4px; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.45; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 8px 10px var(--safe-b);
  background: rgba(12, 11, 10, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  display: grid; grid-template-columns: 1fr 1fr 1fr;
}
.nav a {
  color: var(--muted); text-align: center; padding: 8px 4px; border-radius: 12px;
  font-size: 12px; font-weight: 700;
}
.nav a.active { color: var(--gold); background: #1c1814; }
.cover {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px;
  border: 1px solid var(--line); background: #100e0c;
}
.actions { display: grid; gap: 8px; margin-top: 12px; }
.log { font-size: 12px; color: var(--muted); border-left: 2px solid var(--line); padding: 0 0 10px 10px; }
.log b { color: var(--text); font-weight: 600; }
.switch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.switch:last-child { border-bottom: 0; }
.empty { color: var(--muted); padding: 20px 0; text-align: center; }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  background: #2a2116; color: var(--gold-2); border-radius: 14px; padding: 12px 14px;
  border: 1px solid #4a3a22; z-index: 20;
}
@media (min-width: 860px) {
  .app { max-width: 920px; margin: 0 auto; padding-bottom: 40px; }
  .nav {
    position: static; height: auto; padding: 0; background: none; border: 0;
    display: flex; gap: 8px; justify-content: flex-end;
  }
  .nav a { padding: 8px 12px; }
  .app { display: block; }
  .desktop-bar {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px;
  }
}
