/* Wabrum WMS — рабочий интерфейс склада.
   Правила: кнопки >= 48px, шрифт >= 16px (на ТСД крупнее), высокий контраст, системный шрифт (без загрузки из сети). */
:root {
  --ink: #14161a;
  --ink-2: #4a4f57;
  --paper: #f4f3ef;
  --card: #ffffff;
  --line: #d9d7d0;
  --brand: #1b4dff;
  --brand-ink: #ffffff;
  --ok: #1e8f4e;
  --err: #d0341f;
  --warn: #b7791f;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.4;
}
a { color: var(--brand); }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .6rem; }

.topbar {
  display: flex; align-items: center; gap: .8rem; padding: .6rem 1rem;
  background: var(--ink); color: #fff; min-width: 0;
}
.topbar .brand { font-weight: 700; letter-spacing: .04em; color: #fff; text-decoration: none; font-size: 1.1rem; }
.topbar .who { margin-left: auto; color: #cfd3da; font-size: .95rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar form { margin: 0; }
.topbar .btn { min-height: 40px; padding: .3rem .9rem; flex-shrink: 0; }
.nav { display: flex; flex-wrap: wrap; gap: .4rem; padding: .5rem 1rem; background: #23262c; }
.nav a { color: #e6e8ec; text-decoration: none; padding: .45rem .8rem; border-radius: 6px; min-height: 40px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a.active { background: #3a3f48; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.narrow { max-width: 480px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .6rem 1.2rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-primary:hover { background: #1440d6; }
.btn-danger { color: var(--err); border-color: var(--err); }
.btn-block { width: 100%; }
.btn-lg { min-height: 60px; font-size: 1.2rem; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* формы */
label { display: block; font-weight: 600; margin: .9rem 0 .3rem; }
.hint { color: var(--ink-2); font-size: .92rem; font-weight: 400; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; min-height: 48px; padding: .6rem .8rem; font: inherit; font-size: 1.05rem;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
textarea { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .95rem; }
input:focus, select:focus, textarea:focus { outline: 3px solid #b9c8ff; border-color: var(--brand); }
.check { display: flex; align-items: center; gap: .6rem; margin: .9rem 0; font-weight: 600; }
.check input { width: 24px; height: 24px; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.4rem; }

/* сообщения */
.alert { padding: .8rem 1rem; border-radius: 8px; margin: 0 0 1rem; font-weight: 600; }
.alert-err { background: #fde8e4; color: #8a2113; border: 1px solid #f3b8ad; }
.alert-ok { background: #e2f5e9; color: #145c33; border: 1px solid #a9dfbd; }
.alert-warn { background: #fdf1dc; color: #6f4708; border: 1px solid #f0d49a; }

/* таблицы */
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #ebe9e3; font-size: .95rem; }
tr:last-child td { border-bottom: 0; }
td .btn { min-height: 40px; padding: .3rem .8rem; font-weight: 500; }
.muted { color: var(--ink-2); }
.tag { display: inline-block; padding: .15rem .5rem; border-radius: 6px; background: #ebe9e3; font-size: .9rem; }
.tag-off { background: #fde8e4; color: #8a2113; }
.tag-virtual { background: #e4e9ff; color: #1a3aa8; }
.indent-1 { padding-left: 1.6rem; } .indent-2 { padding-left: 3.2rem; } .indent-3 { padding-left: 4.8rem; } .indent-4 { padding-left: 6.4rem; }
code { background: #ebe9e3; padding: .1rem .35rem; border-radius: 4px; }
pre { background: #ebe9e3; padding: .8rem; border-radius: 8px; overflow-x: auto; }

/* плитки операций кладовщика */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.tiles > * { min-width: 0; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 120px; padding: .8rem; border-radius: 14px; text-decoration: none;
  background: var(--brand); color: #fff; font-size: 1.3rem; font-weight: 700; overflow-wrap: anywhere;
}
.tile:active { transform: scale(.98); }
.tile.disabled { background: #9aa0aa; }
.tile small { display: block; font-size: .8rem; font-weight: 500; opacity: .9; margin-top: .4rem; line-height: 1.2; }

/* PIN-панель для ТСД */
.pin-display { font-size: 2.4rem; letter-spacing: .6rem; text-align: center; min-height: 3.4rem; margin: .8rem 0; font-family: ui-monospace, monospace; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.pin-pad .btn { min-height: 64px; font-size: 1.6rem; }

/* крупнее на маленьких экранах (ТСД 5,7") */
@media (max-width: 480px) {
  html { font-size: 17px; }
  .topbar { padding: .5rem .7rem; }
  .topbar .brand { font-size: 1rem; }
  .tile { font-size: 1.05rem; min-height: 110px; }
  .topbar .brand { white-space: nowrap; }
  .wrap { padding: .8rem .7rem 2rem; }
  th, td { padding: .5rem .5rem; }
}
