/* PLK / логистика · шелл PLK 2.0 по artifacts/reference/index.html (референс не менять, копировать сюда). */
:root {
  color-scheme: light;
  --bg: #edf2f5;
  --panel: #ffffff;
  --panel-soft: #f7f9fb;
  --text: #101820;
  --ink: #101820;
  --muted: #687786;
  --label: #344252;
  --line: #d3dce4;
  --line-strong: #bdcad5;
  --nav: #121b24;
  --nav-soft: #202b36;
  --nav-text: #eef3f7;
  --nav-muted: #9aa8b4;
  --gold: #d6a64a;
  --blue: #2769d8;
  --blue-soft: #eaf1ff;
  --green: #157b59;
  --green-soft: #e8f5ef;
  --amber: #986000;
  --amber-soft: #fff4da;
  --red: #a93640;
  --red-soft: #ffe9eb;
  --shadow: 0 8px 22px rgba(19, 34, 48, 0.06);
  font-family: Arial, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html, body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.4;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: var(--blue); }

/* --- вход ------------------------------------------------------------------------------ */
.login-state {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}
.login-mark {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--gold);
  color: #16202a;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .03em;
}
.login-state h1 { margin: 8px 0 0; font-size: 28px; }
.login-state p { margin: 0 0 8px; color: var(--muted); }
.login-state form { width: min(360px, 100%); display: grid; gap: 10px; text-align: left; }
.login-state label { display: grid; gap: 5px; font-size: 13px; font-weight: 700; }
.login-state input { min-height: 44px; border: 1px solid #bdcbd6; border-radius: 8px; padding: 8px 10px; }
.login-state form button { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; font-weight: 800; }
.login-foot { font-size: 12px; }

/* --- шелл ------------------------------------------------------------------------------ */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.menu-toggle { display: none; }
.sidebar {
  position: sticky; top: 0; align-self: start;
  min-height: 100vh; max-height: 100vh; overflow-y: auto;
  padding: 18px 14px; background: var(--nav); color: var(--nav-text);
  scrollbar-color: #53616e transparent;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 4px 22px; text-decoration: none; color: inherit; }
.brand__mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  flex: 0 0 38px; border-radius: 7px; background: var(--gold); color: #16202a;
  font-size: 12px; font-weight: 900; letter-spacing: .03em;
  box-shadow: 0 6px 16px rgba(0,0,0,.16);
}
.brand strong { display: block; color: var(--nav-text); font-size: 16px; }
.brand small { display: block; margin-top: 1px; color: var(--nav-muted); font-size: 12px; }
.nav-list { display: grid; gap: 3px; }
.nav-button {
  width: 100%; min-height: 40px;
  display: grid; grid-template-columns: 29px minmax(0,1fr) auto;
  gap: 9px; align-items: center; padding: 7px 9px;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: #d7dfe6; text-align: left; text-decoration: none;
  font-size: 14px; font-weight: 700;
}
.nav-button__index { color: #82909c; font-size: 11px; font-weight: 500; }
.nav-button__label { min-width: 0; line-height: 1.18; }
.nav-button__count {
  min-width: 24px; padding: 2px 6px; border-radius: 999px;
  background: rgba(255,255,255,.11); color: #fff; font-size: 11px; text-align: center;
}
.nav-button__count--soon { background: transparent; color: #5f6d79; font-weight: 500; }
.nav-button:hover { background: #1b2630; }
.nav-button.is-active {
  border-color: #35424d; background: var(--nav-soft); color: #fff;
  box-shadow: inset 3px 0 0 var(--gold);
}
.nav-button.is-active .nav-button__index { color: var(--gold); }
.nav-button.is-disabled { color: #6f7d89; cursor: default; }
.nav-button.is-disabled:hover { background: transparent; }
.sidebar__footer {
  display: grid; gap: 3px; margin-top: 20px; padding: 14px 5px 0;
  border-top: 1px solid rgba(255,255,255,.12); color: var(--nav-muted); font-size: 12px;
}
.sidebar__footer strong { margin-top: 8px; color: var(--nav-text); font-size: 13px; }
.sidebar__footer form { margin: 0; }
.sidebar__footer a { color: inherit; }
.sidebar__account { text-decoration: none; }
.sidebar__account:hover strong { text-decoration: underline; }
.sidebar__link { color: #d7dfe6 !important; font-size: 12px; }
.sidebar__footer button {
  min-height: 32px; margin-top: 7px; padding: 0;
  border: 0; background: transparent; color: #d7dfe6; text-decoration: underline; font-size: 12px;
}

.mobile-bar, .mobile-tabs, .drawer-backdrop { display: none; }
.main-area { min-width: 0; width: 100%; padding: 28px 24px 80px; }
.page-head {
  display: grid; grid-template-columns: minmax(230px,1fr) minmax(420px,auto);
  align-items: start; gap: 20px; margin-bottom: 18px;
}
.page-title > span {
  display: block; margin-bottom: 4px; color: #778796;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.page-title h1 { margin: 0; font-size: 30px; line-height: 1.1; }
.page-title p { margin: 7px 0 0; color: var(--muted); }
.session-panel { display: grid; gap: 9px; justify-items: end; }
.session-panel__main, .session-panel__actions {
  display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px;
}
.session-panel form { margin: 0; }
.online-pill {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px;
  padding: 0 12px; border-radius: 999px; color: var(--green); font-size: 13px; font-weight: 800;
}
.online-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.session-user, .soft-button, .role-readback {
  min-height: 38px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--panel); color: var(--label); font-weight: 700;
}
.session-user, .role-readback {
  max-width: 240px; display: inline-flex; align-items: center; padding: 0 12px; line-height: 1.1;
}
a.session-user { text-decoration: none; }
a.session-user:hover { border-color: var(--line-strong); background: var(--panel-soft); }
.soft-button { padding: 0 13px; }
a.soft-button { display: inline-flex; align-items: center; text-decoration: none; }
.soft-button:hover { border-color: var(--line-strong); background: var(--panel-soft); }
.day-button {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 18px;
  border: 1px solid var(--green); border-radius: 7px; background: var(--green); color: #fff;
  font-weight: 700; text-decoration: none;
}

/* --- содержимое ------------------------------------------------------------------------ */
.hint-bar {
  margin: 0 0 16px; padding: 10px 14px;
  border: 1px dashed var(--line-strong); border-radius: 8px;
  background: #f4f7f9; color: var(--muted); font-size: 13px;
}
.flash {
  margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; font-size: 14px; font-weight: 700;
  border: 1px solid var(--line); background: var(--panel);
}
.flash--success { border-color: #b8dbc9; background: var(--green-soft); color: var(--green); }
.flash--info { border-color: #bfd1ef; background: var(--blue-soft); color: var(--blue); }
.flash--error { border-color: #efc0c4; background: var(--red-soft); color: var(--red); }
.flash--warning { border-color: #e5c983; background: var(--amber-soft); color: var(--amber); }
.panel {
  margin-bottom: 16px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); box-shadow: var(--shadow); overflow: hidden;
}
.panel__head {
  min-height: 52px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.panel__head h2 { margin: 0; font-size: 18px; }
.panel__count { color: var(--amber); font-size: 13px; font-weight: 800; }
.panel__body { padding: 16px; }
.panel--amber { border-color: #e5c983; background: var(--amber-soft); }
.panel--blue { border-color: #bfd1ef; background: var(--blue-soft); }
.panel--green { border-color: #b8dbc9; background: var(--green-soft); }
.panel--red { border-color: #efc0c4; background: var(--red-soft); }

.tag {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px;
  border-radius: 999px; background: var(--panel-soft); color: var(--muted);
  font-size: 11.5px; font-weight: 800; white-space: nowrap;
}
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.tag.bad { background: var(--red-soft); color: var(--red); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); font-weight: 700; padding: 8px 10px;
  border-bottom: 1px solid var(--line); background: var(--panel-soft); white-space: nowrap;
}
td { padding: 10px; border-bottom: 1px solid #e8eef2; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcfd; }
.table-wrap { overflow-x: auto; }
.mono { font-family: Menlo, Consolas, monospace; font-size: 12px; }
td a b, td > b, .nowrap { white-space: nowrap; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.form-grid label, .inline-form label {
  display: grid; gap: 5px; font-size: 13px; font-weight: 700; color: var(--label);
}
.form-grid .wide { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea, .inline-form input, .inline-form select, .search {
  min-height: 44px; border: 1px solid #bdcbd6; border-radius: 8px; padding: 8px 10px; background: #fff; min-width: 0;
  font-weight: 400;
}
.form-grid textarea { min-height: 90px; resize: vertical; }
.form-grid label.has-error input, .form-grid label.has-error select { border-color: var(--red); }
.field-error { color: var(--red); font-size: 12px; font-weight: 700; }
.checkbox-line {
  display: flex !important; flex-direction: row; align-items: center; gap: 8px; font-weight: 700;
}
.checkbox-line input { width: 18px; height: 18px; min-height: 18px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.form-actions form, .panel__body form.form-actions { margin: 0; }
.button, .panel__body > button, form button, .actions button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 0 13px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--panel); color: var(--label); font-weight: 800; text-decoration: none;
}
.primary { border-color: var(--blue) !important; background: var(--blue) !important; color: #fff !important; }
.danger { border-color: var(--red) !important; background: var(--red-soft) !important; color: var(--red) !important; }
.inline-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.inline-form input, .inline-form select { flex: 1 1 180px; }
.inline-form label { flex: 1 1 180px; }

.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; }
.akro-detail-grid {
  display: grid; grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr); gap: 12px;
}
.akro-detail-grid .panel { margin-bottom: 16px; }
.akro-detail-grid .form-grid > p {
  display: grid; gap: 5px; align-content: start; margin: 0;
  color: var(--label); font-size: 13px; font-weight: 700;
}
.akro-detail-grid .form-grid > p input,
.akro-detail-grid .form-grid > p textarea { width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { color: var(--muted); padding: 18px 0; }
.method {
  display: inline-block; font-size: 11px; font-weight: 800; color: #5d6c79;
  background: #eef3f6; border-radius: 4px; padding: 1px 6px;
}
.error-text { color: var(--red); font-size: 13px; }
.dl { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); font-size: 12.5px; font-weight: 700; padding-top: 2px; }
.dl dd { margin: 0; }
.stack { display: grid; gap: 12px; align-content: start; }
.stack .panel { margin-bottom: 0; }

/* --- пагинация (0.1.1) ----------------------------------------------------------------- */
.pagination {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel-soft);
}
.pagination .button { min-height: 34px; padding: 0 11px; }
.pagination .button.is-current { border-color: var(--nav); background: var(--nav); color: #fff; }
.pagination__gap { padding: 0 4px; color: var(--muted); font-weight: 800; }
.pagination__info { margin-left: auto; color: var(--muted); font-size: 12.5px; }

/* --- пользователи и пароли (0.1.1) ----------------------------------------------------- */
.secret-box {
  display: inline-block; padding: 10px 16px; border: 1px dashed var(--amber); border-radius: 8px;
  background: #fff; color: var(--ink); font-family: Menlo, Consolas, monospace; font-size: 20px;
  letter-spacing: .06em; user-select: all; -webkit-user-select: all;
}
.secret-box--login { font-size: 15px; letter-spacing: .02em; border-color: var(--line-strong); }
.form-grid .muted.small { font-weight: 400; }

@media (max-width: 1280px) {
  .page-head { grid-template-columns: 1fr; }
  .session-panel { justify-items: start; }
  .session-panel__main, .session-panel__actions { justify-content: flex-start; }
  .split { grid-template-columns: 1fr; }
  .akro-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .pagination__info { margin-left: 0; flex-basis: 100%; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .app-shell { display: block; padding-top: 72px; }
  .sidebar {
    position: fixed; inset: 72px auto 0 0; z-index: 40;
    width: min(330px, 88vw); min-height: 0; max-height: calc(100vh - 72px);
    transform: translateX(-105%); transition: transform .2s ease;
    box-shadow: 20px 0 50px rgba(0,0,0,.3);
  }
  .menu-toggle:checked ~ .sidebar { transform: translateX(0); }
  .sidebar .brand { display: none; }
  .drawer-backdrop {
    position: fixed; inset: 72px 0 0; z-index: 35; display: none;
    border: 0; background: rgba(12,20,28,.48);
  }
  .menu-toggle:checked ~ .drawer-backdrop { display: block; }
  .mobile-bar {
    position: fixed; inset: 0 0 auto; z-index: 45; height: 72px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 10px 15px; background: var(--nav); color: #fff;
  }
  .mobile-bar .brand { padding: 0; }
  .mobile-menu-button {
    display: inline-flex; align-items: center; min-height: 42px; padding: 0 13px; border: 0; border-radius: 7px;
    background: #1f2b36; color: #fff; font-weight: 800; cursor: pointer;
  }
  .main-area { padding: 20px 16px 88px; }
  .form-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
  .mobile-tabs {
    position: fixed; inset: auto 0 0; z-index: 42;
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 8px env(safe-area-inset-right) calc(8px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
    background: var(--nav);
  }
  .mobile-tabs a {
    display: grid; place-items: center; min-height: 48px; padding: 4px;
    color: #cad4dd; font-size: 12px; font-weight: 700; text-decoration: none;
  }
}
@media (max-width: 560px) {
  .page-title h1 { font-size: 28px; }
  .main-area { padding: 18px 10px 88px; }
}
