:root {
  --accent: #c48764;
  --ink: #292929;
  --muted: #69625d;
  --line: #e5ddd7;
  --paper: #fff;
  --bg: #f5f2ef;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}
a {
  color: inherit;
}
header {
  background: var(--ink);
  color: #fff;
  padding: 20px 28px;
}
header h1 {
  font-size: 24px;
}
header p,
header a {
  color: #eee;
}
main {
  max-width: 1320px;
  margin: 28px auto;
  padding: 0 24px;
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}
.brand-name {
  font-size: clamp(19px, 2.4vw, 28px);
  font-weight: 750;
  letter-spacing: 0.025em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.brand-name small {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  margin-top: 8px;
}
.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
}
.nav a {
  padding: 10px 14px;
  text-decoration: none;
  border-radius: 5px;
}
.nav a[aria-current="page"] {
  background: var(--accent);
  font-weight: bold;
}
.nav button {
  margin-left: auto;
  padding: 8px 14px;
  background: #eee;
  color: #222;
}
.card,
.panel,
.stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 24px;
  margin-bottom: 18px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}
.stat strong {
  display: block;
  font-size: 30px;
  margin-top: 10px;
}
.toolbar,
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}
button,
.button {
  background: var(--accent);
  color: #292929;
  border: 0;
  border-radius: 6px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
  border: 1px solid #bbb;
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}
input[type="checkbox"] {
  width: auto;
}
textarea {
  width: 100%;
  min-height: 90px;
}
label {
  display: block;
  font-size: 14px;
  margin: 10px 0;
}
label input,
label select {
  display: block;
  width: 100%;
  margin-top: 5px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 13px;
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
}
.muted {
  color: var(--muted);
}
.error {
  color: #a21d1d;
}
.notice {
  background: #f5e9e1;
  border-left: 4px solid var(--accent);
  padding: 14px;
  margin: 12px 0;
  border-radius: 4px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.entry {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  overflow-wrap: anywhere;
}
.entry p {
  white-space: pre-wrap;
}
.overdue {
  color: #a21d1d;
  font-weight: bold;
}
.badge {
  display: inline-block;
  background: #eee;
  padding: 4px 8px;
  border-radius: 5px;
}
#original {
  white-space: pre-wrap;
}
#page-error {
  margin: 16px 24px;
}
.login-main {
  max-width: 420px;
  margin: 12vh auto;
}
.login-main input {
  width: 100%;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid #925a3c;
  outline-offset: 3px;
}
@media (max-width: 700px) {
  main {
    padding: 0 12px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .nav {
    padding: 8px;
    gap: 2px;
  }
  .nav a {
    padding: 10px;
  }
  .card,
  .panel {
    padding: 16px;
  }
  .toolbar > * {
    max-width: 100%;
  }
  th,
  td {
    padding: 10px 8px;
  }
}
@media (max-width: 700px) {
  .item-table,
  .item-table tbody,
  .item-table tr,
  .item-table td {
    display: block;
    width: 100%;
  }
  .item-table thead {
    display: none;
  }
  .item-table tr {
    border-top: 1px solid var(--line);
  }
  .item-table td {
    border: 0;
    padding: 8px 0;
    overflow-wrap: anywhere;
  }
  .item-table td::before {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 5px;
  }
  .item-table td:nth-child(1)::before {
    content: "Материал";
  }
  .item-table td:nth-child(2)::before {
    content: "Заказано";
  }
  .item-table td:nth-child(3)::before {
    content: "Доставлено";
  }
  .item-table td:nth-child(4)::before {
    content: "Статус";
  }
  .item-table td:nth-child(5)::before {
    content: "Действия";
  }
  .item-table input,
  .item-table select {
    width: 100%;
  }
  .item-table .actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Shared corporate presentation. Working content stays on opaque surfaces. */
body {
  line-height: 1.5;
}
header {
  border-bottom: 3px solid var(--accent);
}
h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.025em;
}
h1 {
  font-size: clamp(25px, 3vw, 36px);
}
h2 {
  font-size: 21px;
  margin-top: 0;
}
.card,
.panel,
.stat,
.logistics-stat {
  box-shadow: 0 5px 22px #29292905;
}
.stat {
  border-top: 3px solid var(--accent);
}
.nav a,
button,
.button {
  min-height: 44px;
}
button:hover:not(:disabled),
.button:hover {
  background: #d59c7b;
}
.nav a:hover {
  background: #f5e9e1;
}
.nav a[aria-current="page"] {
  color: var(--ink);
}
input,
select,
textarea {
  min-height: 44px;
  color: var(--ink);
  font-size: 16px;
}
input[type="checkbox"] {
  min-height: auto;
  accent-color: #925a3c;
}
input::placeholder,
textarea::placeholder {
  color: #736b65;
  opacity: 1;
}
th {
  background: #faf7f5;
  font-weight: 650;
}
tbody tr:hover {
  background: #fbf8f6;
}
.badge {
  background: #f0e4dc;
  color: #6e442e;
  border: 1px solid #dbc2b2;
}
.toolbar input[type="search"],
#search {
  flex: 1 1 220px;
  min-width: 0;
}
.portal-banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(115deg, #292929, #51433b);
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 32px 36px;
  margin-bottom: 26px;
}
.portal-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #000c, #0007);
  z-index: -1;
}
.portal-banner h2 {
  font-size: clamp(24px, 3vw, 36px);
  margin: 7px 0 10px;
  max-width: 700px;
}
.portal-banner p {
  max-width: 650px;
  margin-bottom: 0;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0 0 12px;
}
.portal-banner .eyebrow,
.login-intro .eyebrow {
  color: #edc5ac;
}
.login-page {
  min-height: 100vh;
  min-height: 100svh;
  background-color: var(--ink);
  background-size: cover;
  background-position: center;
  display: grid;
  align-items: center;
  position: relative;
  isolation: isolate;
}
.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}
.login-layout {
  width: 100%;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: center;
  gap: 70px;
  padding: 48px 40px;
}
.login-intro {
  color: white;
  background: transparent;
  padding: 24px;
  border-radius: 0 12px 12px 0;
}

/* Login composition: one image overlay only; never add an opaque intro panel. */
.login-page .login-layout {
  max-width: 640px;
  grid-template-columns: minmax(0, 1fr);
  padding: 28px 20px;
  gap: 28px;
  background: transparent;
}
.login-page .login-intro {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.login-page .login-intro h1 {
  font-size: clamp(26px, 5.8vw, 38px);
  margin: 0;
  line-height: 1.22;
}
.login-page .login-title {
  white-space: normal;
  overflow-wrap: anywhere;
}
.login-page .login-intro .brand-name small {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.16em;
  margin-top: 16px;
}
.login-page .login-card {
  max-width: none;
  box-shadow: none;
}
@media (min-width: 1100px) {
  .login-page .login-layout {
    max-width: 1480px;
    padding: 48px;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
    gap: 48px;
  }
  .login-page .login-intro h1 {
    font-size: clamp(26px, 2.4vw, 42px);
  }
  .login-page .login-title {
    white-space: nowrap;
    overflow-wrap: normal;
  }
  .login-page .login-intro .brand-name small {
    font-size: 16px;
  }
}
.login-intro h1 {
  font-size: clamp(32px, 4vw, 54px);
  margin: 24px 0;
}
.login-intro .brand-name small {
  font-size: clamp(11px, 1.3vw, 16px);
  color: #edc5ac;
  line-height: 1.6;
}
.login-description {
  color: #e9e1db;
  font-size: 18px;
  line-height: 1.7;
}
.login-card {
  max-width: 450px;
  width: 100%;
  padding: 36px;
  margin: 0;
  border-top: 4px solid var(--accent);
  box-shadow: 0 24px 70px #0004;
}
.login-card .eyebrow {
  color: #895335;
}
.login-card h2 {
  font-size: 28px;
  margin-bottom: 12px;
}
.login-card input,
.login-card button {
  width: 100%;
}
.login-card button {
  margin-top: 22px;
  font-size: 16px;
}
.login-card label {
  margin-top: 18px;
}
.login-card .error {
  margin-top: 16px;
}
@media (max-width: 800px) {
  .login-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px 20px;
    margin: 0 auto;
    max-width: 540px;
  }
  .login-intro h1 {
    font-size: 30px;
    margin: 16px 0;
  }
  .login-description {
    display: none;
  }
  .login-card {
    max-width: none;
    padding: 26px;
  }
}
@media (max-width: 700px) {
  header {
    padding: 20px 16px;
  }
  .brand-name {
    font-size: 19px;
  }
  .brand-name small {
    font-size: 9px;
    letter-spacing: 0.16em;
  }
  .portal-banner {
    padding: 24px 20px;
    margin-bottom: 20px;
  }
  .nav button {
    margin-left: 0;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar > input,
  .toolbar > select {
    flex: 1 1 100%;
    width: 100%;
  }
  .stats {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  .button,
  .nav a {
    transition: background-color 0.15s ease;
  }
}

/* Mobile-first working layouts; desktop tables are enabled from 900px. */
html {
  scroll-padding-top: calc(var(--portal-header-height, 80px) + 16px);
}
body {
  overflow-wrap: anywhere;
}
main,
section,
form,
.card,
.panel,
.grid > *,
.logistics-grid > *,
label {
  min-width: 0;
}
main {
  width: 100%;
  padding-inline: 12px;
}
header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}
header .brand {
  flex: 1;
  min-width: 0;
}
header .brand-name {
  font-size: 15px;
}
header .brand-name small {
  font-size: 10px;
  letter-spacing: 0.12em;
  margin-top: 5px;
}
.has-navigation {
  padding-bottom: calc(82px + env(safe-area-inset-bottom));
}
.has-navigation header {
  position: sticky;
  top: 0;
  z-index: 30;
}
.menu-toggle {
  min-width: 64px;
  flex-shrink: 0;
  padding: 10px;
}
.nav {
  display: none;
}
.nav.is-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  position: sticky;
  top: var(--portal-header-height, 80px);
  z-index: 25;
  max-height: min(
    65svh,
    calc(100svh - var(--portal-header-height, 80px) - 90px)
  );
  overflow-y: auto;
  box-shadow: 0 12px 24px #2929291a;
}
.nav a,
.nav button {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
}
.quick-nav {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px #2929290a;
}
.quick-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 48px;
  text-decoration: none;
  font-size: 13px;
  border-radius: 8px;
}
.quick-nav a[aria-current] {
  background: var(--accent);
  font-weight: 700;
}
button,
.button,
input:not([type="checkbox"]):not([type="hidden"]),
select {
  min-height: 48px;
}
button,
.button {
  min-width: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
}
input:not([type="checkbox"]),
select,
textarea {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  font-size: 16px;
}
input::-webkit-date-and-time-value {
  min-width: 0;
  text-align: start;
}
input[type="file"] {
  padding: 8px;
  overflow: hidden;
}
input[type="file"]::file-selector-button {
  min-height: 44px;
  margin-right: 8px;
  border: 0;
  border-radius: 5px;
  padding: 8px;
  background: #f0e4dc;
  color: var(--ink);
}
label:has(input[type="checkbox"]) {
  min-height: 48px;
  align-content: center;
}
input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.grid {
  grid-template-columns: minmax(0, 1fr);
}
.actions,
.logistics-actions {
  align-items: stretch;
}
.actions > button,
.logistics-actions > button {
  flex: 1 1 160px;
}
.form-submit {
  position: static;
  width: 100%;
}
.form-jump {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  background: #f5e9e1;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
.list-count {
  font-size: 12px;
  color: var(--muted);
  grid-column: 1 / -1;
}
.notifications-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  flex-shrink: 0;
  border: 1px solid #c4876470;
  border-radius: 8px;
  text-decoration: none;
  font-size: 20px;
}
.notification-count {
  position: absolute;
  top: -6px;
  right: -4px;
  border-radius: 12px;
  padding: 1px 5px;
  min-width: 20px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent);
  color: var(--ink);
}
.notification-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}
.notification-check input {
  width: 22px;
  margin: 0;
}
.notification-entry {
  padding: 16px;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.notification-entry.unread {
  border-left: 4px solid var(--accent);
  background: #fcf7f3;
}
.notification-entry a {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-weight: 600;
}
#push-preferences fieldset {
  min-width: 0;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.notice,
.entry,
td,
th,
a,
h1,
h2,
h3 {
  overflow-wrap: anywhere;
}
#page-error {
  position: relative;
  z-index: 6;
  margin-inline: 0;
}
.portal-banner {
  padding: 20px;
  margin-bottom: 18px;
}
.portal-banner h2 {
  font-size: 25px;
}
.portal-banner p:not(.eyebrow) {
  font-size: 14px;
}
.portal-banner .eyebrow {
  font-size: 9px;
}
.list-tools {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}
.list-tools label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.table-wrap {
  overflow: visible;
}
.responsive-table,
.responsive-table tbody {
  display: block;
  width: 100%;
}
.responsive-table {
  border-collapse: separate;
}
.responsive-table thead {
  display: block;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.responsive-table tbody tr {
  display: block;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.responsive-table tbody td {
  display: block;
  width: 100%;
  padding: 8px 0;
  border: 0;
  white-space: normal;
}
.responsive-table tbody td::before {
  content: attr(data-label);
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}
.responsive-table td[data-label=""]::before {
  display: none;
}
.responsive-table td a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
}
.responsive-table td button {
  width: 100%;
  text-align: start;
}
.login-layout {
  padding: 20px 12px;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
  max-width: 540px;
}
.login-intro {
  padding: 18px;
}
.login-intro h1 {
  font-size: 27px;
}
.login-intro .eyebrow {
  font-size: 9px;
}
.login-card {
  padding: 22px;
}
dialog {
  width: calc(100% - 24px);
  max-width: 600px;
  max-height: 85svh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}
@media (min-width: 600px) {
  main {
    padding-inline: 24px;
  }
  .list-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  header .brand-name {
    font-size: 21px;
  }
  header .brand-name small {
    font-size: 10px;
  }
  .portal-banner {
    padding: 28px;
  }
  .login-layout {
    padding: 32px 24px;
  }
}
@media (min-width: 900px) {
  .has-navigation {
    padding-bottom: 0;
  }
  .has-navigation header {
    position: static;
  }
  header {
    padding: 20px 28px;
  }
  header .brand-name {
    font-size: 28px;
  }
  .menu-toggle,
  .quick-nav {
    display: none;
  }
  .nav,
  .nav.is-open {
    display: flex;
    position: static;
    max-height: none;
    box-shadow: none;
  }
  .nav a,
  .nav button {
    width: auto;
  }
  .nav button {
    margin-left: auto;
  }
  .table-wrap {
    overflow: auto;
  }
  .responsive-table {
    display: table;
    border-collapse: collapse;
  }
  .responsive-table thead {
    display: table-header-group;
    position: static;
    width: auto;
    height: auto;
    clip-path: none;
    white-space: normal;
  }
  .responsive-table tbody {
    display: table-row-group;
  }
  .responsive-table tbody tr {
    display: table-row;
    border: 0;
    background: transparent;
  }
  .responsive-table tbody td {
    display: table-cell;
    width: auto;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
  }
  .responsive-table tbody td::before {
    display: none;
  }
  .responsive-table td button {
    width: auto;
  }
  .form-submit {
    position: static;
    width: auto;
    box-shadow: none;
    justify-self: start;
  }
  .form-jump {
    display: none;
  }
  .portal-banner h2 {
    font-size: 36px;
  }
  .login-layout {
    padding: 48px 40px;
    grid-template-columns: 1.3fr 1fr;
    max-width: 1320px;
  }
  .login-intro {
    padding: 24px;
  }
  .login-intro h1 {
    font-size: clamp(32px, 4vw, 54px);
  }
  .login-card {
    padding: 36px;
  }
}
