/* Слой 2 — Раскладка экранов (концепция № 2). Только расположение блоков.
   Цвета/шрифты/скругления — только через переменные из theme.css. */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs-md);
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }

/* Шапка */
.hd {
  display: flex; align-items: center; gap: var(--gap-sm);
  padding: var(--gap-md);
  padding-top: calc(var(--gap-md) + env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.logo {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-text);
  display: grid; place-items: center; font-weight: 800; flex: none;
}
.hd h1 { font-size: var(--fs-lg); flex: 1; min-width: 0; }
.hd h1 small { display: block; font-size: var(--fs-xs); color: var(--text-muted); font-weight: 500; }
.hd-btn { font-size: var(--fs-sm); font-weight: 600; color: var(--accent); padding: 8px; }

/* Контейнер */
.wrap { max-width: 480px; margin: 0 auto; padding: 0 0 var(--gap-lg); }

/* Карточка */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); margin: var(--gap-md); padding: var(--gap-md);
}
.card h2 { font-size: var(--fs-lg); margin-bottom: var(--gap-xs); }
.card h3 { font-size: var(--fs-md); margin-bottom: var(--gap-sm); }
.muted { color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.4; }

/* Экран входа */
.login-hero { text-align: center; padding: 40px var(--gap-md) 8px; }
.login-hero .logo { width: 56px; height: 56px; margin: 0 auto var(--gap-md); font-size: var(--fs-xl); border-radius: var(--radius-lg); }
.login-hero h1 { font-size: var(--fs-xl); }
.role-chip {
  display: inline-block; margin-top: var(--gap-sm); padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: var(--fs-sm); font-weight: 600;
}

.field-label { display: block; font-size: var(--fs-sm); color: var(--text-muted); margin: var(--gap-md) 0 var(--gap-xs); }
.field {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0 14px; min-height: 52px;
}
.field:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.field .prefix { font-weight: 600; }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: var(--fs-lg); padding: 12px 0; }
.field input.code { text-align: center; letter-spacing: .5em; font-size: var(--fs-code); font-weight: 700; padding-left: .5em; }

.btn {
  display: block; width: 100%; margin-top: var(--gap-md); min-height: 50px; border-radius: var(--radius-md);
  background: var(--accent); color: var(--accent-text); font-weight: 600; font-size: var(--fs-md);
}
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .link:focus-visible { outline: none; box-shadow: var(--focus); }
.link { color: var(--accent); font-weight: 600; font-size: var(--fs-sm); padding: 8px 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--gap-sm); margin-top: var(--gap-sm); }

.msg { min-height: 20px; margin-top: var(--gap-sm); font-size: var(--fs-sm); line-height: 1.4; }
.msg.err { color: var(--danger); }
.msg.dev { color: var(--text-muted); }

/* Главный экран: объекты прораба */
.item { display: flex; gap: 12px; align-items: flex-start; padding: var(--gap-sm) 0; border-top: 1px solid var(--border); }
.item:first-of-type { border-top: 0; }
.item .ic {
  width: 40px; height: 40px; border-radius: var(--radius-md); flex: none;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700;
}
.item div { flex: 1; min-width: 0; font-weight: 600; font-size: var(--fs-md); }
.item small { display: block; color: var(--text-muted); font-weight: 400; font-size: var(--fs-xs); margin-top: 2px; }

.center { display: grid; place-items: center; min-height: 60vh; color: var(--text-muted); text-align: center; padding: var(--gap-md); }
