/*
 * QRoPass Panel — единая фирменная дизайн-система.
 *
 * Визуальный язык основан на корпоративном сайте ЭГОНОМ:
 * Montserrat, спокойные сине-серые акценты и светлые поверхности,
 * ясная типографическая иерархия и предсказуемые интерактивные элементы.
 */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* Основные токены интерфейса. */
:root {
  --brand-950: #2f4135;
  --brand-900: #405947;
  --brand-800: #4f6b54;
  --brand-700: #5f7c62;
  --brand-600: #718d70;
  --brand-100: #e8efe5;
  --brand-050: #f4f7f1;
  --canvas: #f5f5f0;
  --surface: #fffefa;
  --surface-soft: #f8f8f4;
  --surface-muted: #eef1e9;
  --ink: #29332d;
  --ink-soft: #59645d;
  --ink-faint: #778178;
  --line: #e2e5dc;
  --line-strong: #cbd3c7;
  --success: #27835a;
  --success-soft: #e8f6ef;
  --warning: #a96918;
  --warning-soft: #fff4df;
  --danger: #b74444;
  --danger-soft: #fff0f0;
  --sidebar-w: 250px;
  --radius-sm: 10px;
  --radius-md: 15px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 14px rgba(47, 65, 53, .055);
  --shadow-md: 0 14px 38px rgba(47, 65, 53, .08);
}

/* Нормализация и базовая типографика. */
* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 0, rgba(111, 138, 112, .07), transparent 34rem),
    var(--canvas);
  font: 500 15px/1.55 "Montserrat", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Каркас административной панели. */
.admin-shell {
  min-height: 100vh;
  padding-left: var(--sidebar-w);
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-w);
  padding: 28px 18px 20px;
  display: flex;
  flex-direction: column;
  color: #fffefa;
  background:
    radial-gradient(circle at 18% 2%, rgba(111, 138, 112, .12), transparent 16rem),
    linear-gradient(180deg, var(--brand-900), var(--brand-950));
  box-shadow: 12px 0 34px rgba(47, 65, 53, .07);
}

/* Логотип и фирменный знак. */
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 10px 34px;
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  color: #fffefa;
  border: 2px solid rgba(255, 255, 255, .86);
  border-radius: 12px;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: currentColor;
  box-shadow:
    8px 0 currentColor,
    -8px 0 currentColor,
    0 8px currentColor,
    0 -8px currentColor;
}

.brand-mark::after {
  transform: rotate(45deg) scale(.74);
  opacity: .82;
}

.brand-name {
  display: block;
  color: #fffefa;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.035em;
}

.brand-name small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, .62);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .105em;
}

/* Боковая навигация. */
.side-nav {
  display: grid;
  gap: 7px;
}

.nav-link {
  position: relative;
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: rgba(255, 255, 255, .72);
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  transition:
    color .18s ease,
    background-color .18s ease,
    transform .18s ease;
}

.nav-link i {
  width: 21px;
  flex: none;
  font-size: 18px;
  text-align: center;
}

.nav-link:hover {
  color: #fffefa;
  background: rgba(255, 255, 255, .08);
  transform: translateX(2px);
}

.nav-link.active {
  color: var(--brand-900);
  background: #fffefa;
  border-color: rgba(255, 255, 255, .92);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .17);
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: -8px;
  width: 4px;
  height: 24px;
  background: #91a88c;
  border-radius: 999px;
}

/* Карточка авторизованного сотрудника. */
.sidebar-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}

.user-card {
  padding: 9px 8px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.avatar {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--brand-900);
  background: #fffefa;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.user-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name,
.user-role {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-name {
  color: #fffefa;
  font-size: 12px;
  font-weight: 700;
}

.user-role {
  margin-top: 2px;
  color: rgba(255, 255, 255, .6);
  font-size: 10px;
  font-weight: 500;
}

.logout-form {
  flex: none;
  margin: 0;
}

.logout {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: rgba(255, 255, 255, .65);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: .18s ease;
}

.logout:hover {
  color: #fffefa;
  background: rgba(255, 255, 255, .12);
}

.mobile-bar,
.mobile-nav {
  display: none;
}

/* Основная рабочая область. */
.main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 42px clamp(30px, 3.1vw, 60px) 68px;
}

.page-head {
  min-height: 86px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.page-head h1 {
  margin: 0;
  color: var(--brand-900);
  font-size: clamp(32px, 2.7vw, 42px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -.045em;
}

.page-head p {
  max-width: 760px;
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Кнопки и состояния фокуса. */
.btn-solid,
.btn-quiet {
  min-height: 46px;
  padding: 0 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    background-color .16s ease,
    border-color .16s ease;
}

.btn-solid {
  color: #fffefa;
  background: var(--brand-900);
  border-color: var(--brand-900);
  box-shadow: 0 8px 18px rgba(47, 65, 53, .14);
}

.btn-solid:hover {
  background: var(--brand-800);
  border-color: var(--brand-800);
  box-shadow: 0 11px 24px rgba(47, 65, 53, .18);
  transform: translateY(-1px);
}

.btn-quiet {
  color: var(--brand-900);
  background: #fffefa;
  border-color: var(--line-strong);
}

.btn-quiet:hover {
  background: var(--brand-050);
  border-color: #b7c5b1;
  transform: translateY(-1px);
}

.btn-sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.nav-link:focus-visible,
.logout:focus-visible,
.btn-solid:focus-visible,
.btn-quiet:focus-visible,
.input:focus-visible,
.filter-select:focus-visible,
.password-toggle:focus-visible {
  outline: 3px solid rgba(95, 124, 98, .22);
  outline-offset: 2px;
}

/* Поверхности и заголовки панелей. */
.panel,
.stat-card,
.quick-action {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.panel {
  overflow: hidden;
  border-radius: var(--radius-md);
}

.panel-head {
  min-height: 68px;
  padding: 17px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel h2 {
  margin: 0;
  color: var(--brand-900);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -.015em;
}

.panel-link {
  color: var(--ink-faint);
  font-size: 12px;
  white-space: nowrap;
}

/* Карточки показателей. */
.stat-grid {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  position: relative;
  min-height: 148px;
  padding: 22px;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand-600), var(--brand-900));
}

.stat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--brand-700);
  background: var(--brand-100);
  border-radius: 12px;
  font-size: 17px;
}

.stat-card .label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.stat-card .value {
  margin-top: 12px;
  color: var(--brand-900);
  font-size: clamp(30px, 2.5vw, 40px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.045em;
}

.stat-card .meta {
  margin-top: 13px;
  color: var(--ink-faint);
  font-size: 11px;
}

.meta.good {
  color: var(--success);
}

.meta i {
  margin-right: 5px;
}

/* Дашборд и состояние системы. */
.dashboard-grid {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(330px, .9fr);
  gap: 16px;
  align-items: stretch;
}

.dashboard-grid > .panel {
  min-height: 350px;
}

.today-list {
  padding: 4px 20px 12px;
}

.today-row {
  min-height: 59px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.today-row:last-child {
  border-bottom: 0;
}

.round-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--brand-700);
  background: var(--brand-050);
  border-radius: 10px;
}

.today-value {
  color: var(--brand-900);
  font-weight: 700;
}

.quick-actions {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 360px));
  gap: 12px;
}

.quick-action {
  min-height: 86px;
  padding: 17px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 13px;
  transition:
    transform .17s ease,
    border-color .17s ease,
    box-shadow .17s ease;
}

.quick-action:hover {
  border-color: #c2cfbd;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.quick-icon {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  color: #fffefa;
  background: var(--brand-900);
  border-radius: 12px;
  font-size: 17px;
}

.quick-action strong,
.quick-action small {
  display: block;
}

.quick-action strong {
  color: var(--brand-900);
  font-size: 13px;
}

.quick-action small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 11px;
}

/* Таблицы. */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 13px 16px;
  color: #626d63;
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 15px 16px;
  color: var(--ink);
  border-top: 1px solid var(--line);
  font-size: 12px;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color .15s ease;
}

.data-table tbody tr:hover {
  background: var(--brand-050);
}

.data-table small {
  color: var(--ink-faint);
}

.ticket-id-code {
  color: var(--brand-900);
  font-weight: 700;
}

.status-tag {
  min-height: 26px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  color: var(--brand-700);
  background: var(--brand-100);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

/* Пустые состояния. */
.empty-state {
  min-height: 220px;
  padding: 30px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--ink-soft);
  text-align: center;
  font-size: 13px;
}

.empty-state i {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  color: var(--brand-700);
  background: var(--brand-100);
  border-radius: 14px;
  font-size: 19px;
}

.empty-state strong {
  color: var(--brand-900);
  font-size: 15px;
}

.empty-state span {
  color: var(--ink-soft);
  font-size: 12px;
}

/* Формы. */
.form-card-body {
  padding: 22px;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 14px;
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  margin-bottom: 7px;
  color: #465248;
  font-size: 12px;
  font-weight: 700;
}

.input,
.filter-select {
  width: 100%;
  min-height: 47px;
  padding: 0 14px;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition:
    border-color .16s ease,
    box-shadow .16s ease,
    background-color .16s ease;
}

.input::placeholder {
  color: #92998d;
}

.input:hover,
.filter-select:hover {
  border-color: #bac4b4;
}

.input:focus,
.filter-select:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 4px rgba(95, 124, 98, .12);
}

.form-hint {
  display: block;
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 11px;
}

.form-actions {
  margin-top: 7px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
}

/* Генератор и просмотр QR-кода. */
.generator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(360px, .72fr);
  gap: 18px;
  align-items: start;
}

.type-switch {
  margin-bottom: 22px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--surface-muted);
  border-radius: 12px;
}

.type-switch button {
  min-height: 43px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.type-switch button.active {
  color: #fffefa;
  background: var(--brand-900);
  box-shadow: 0 5px 13px rgba(47, 65, 53, .14);
}

.preview-panel {
  position: sticky;
  top: 28px;
  min-height: 580px;
  padding: 26px;
  text-align: center;
}

.preview-panel h2 {
  font-size: 18px;
}

.preview-copy {
  margin: 7px 0 24px;
  color: var(--ink-soft);
  font-size: 12px;
}

.qr-placeholder {
  min-height: 330px;
  padding: 28px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--ink-soft);
  background:
    linear-gradient(135deg, rgba(232, 239, 229, .74), rgba(247, 248, 251, .7));
  border: 1px dashed #b7c5b1;
  border-radius: 16px;
}

.qr-placeholder-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  color: var(--brand-700);
  background: #fffefa;
  border-radius: 17px;
  box-shadow: var(--shadow-sm);
  font-size: 24px;
}

.qr-placeholder strong,
.qr-placeholder small {
  display: block;
}

.qr-placeholder strong {
  color: var(--brand-900);
  font-size: 14px;
}

.qr-placeholder small {
  max-width: 250px;
  color: var(--ink-faint);
  font-size: 11px;
}

.qr-preview {
  width: min(310px, 82%);
  margin: 0 auto;
  padding: 18px;
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: var(--shadow-md);
}

.qr-preview img {
  width: 100%;
  display: block;
}

.preview-actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.result-box {
  margin-top: 15px;
  padding: 14px;
  color: #465248;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: 500 11px/1.55 "Cascadia Mono", Consolas, monospace;
  text-align: left;
  word-break: break-all;
}

/* Сообщения системы. */
.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.alert-success {
  color: #19623f;
  background: var(--success-soft);
  border-color: #bee6d2;
}

.alert-danger {
  color: #913636;
  background: var(--danger-soft);
  border-color: #efc8c8;
}

/* Экран входа и страница ограничения доступа. */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr);
  background: #fffefa;
}

.login-art {
  position: relative;
  min-height: 100vh;
  padding: clamp(38px, 5vw, 74px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: #fffefa;
  background:
    radial-gradient(circle at 76% 24%, rgba(111, 138, 112, .34), transparent 24rem),
    linear-gradient(145deg, var(--brand-900), var(--brand-950));
}

.login-art::before,
.login-art::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 50%;
}

.login-art::before {
  width: 560px;
  height: 560px;
  right: -170px;
  top: 90px;
}

.login-art::after {
  width: 340px;
  height: 340px;
  right: 30px;
  top: 200px;
}

.login-art .brand {
  position: relative;
  z-index: 1;
  padding: 0;
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.login-copy .eyebrow {
  color: rgba(255, 255, 255, .72);
}

.login-copy h1 {
  margin: 0;
  max-width: 690px;
  color: #fffefa;
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -.055em;
}

.login-copy p {
  max-width: 560px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, .72);
  font-size: 16px;
  line-height: 1.7;
}

.login-meta {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, .56);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.login-form-side {
  min-height: 100vh;
  padding: 38px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 100% 0, rgba(111, 138, 112, .07), transparent 24rem),
    #fffefa;
}

.login-card {
  width: min(100%, 430px);
}

.login-card > .bi-shield-lock {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  color: var(--brand-700);
  background: var(--brand-100);
  border-radius: 16px;
  font-size: 22px;
}

.login-card h2 {
  margin: 0;
  color: var(--brand-900);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.035em;
}

.login-card > p {
  margin: 10px 0 30px;
  color: var(--ink-soft);
  font-size: 13px;
}

.password-wrap {
  position: relative;
}

.password-wrap .input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 35px;
  height: 35px;
  color: var(--ink-faint);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.login-foot-link {
  margin-top: 24px;
  color: var(--ink-faint);
  text-align: center;
  font-size: 11px;
}

.login-foot-link a {
  color: var(--brand-700);
  font-weight: 700;
}

/* Адаптация для ноутбуков и планшетов. */
@media (max-width: 1280px) {
  :root {
    --sidebar-w: 224px;
  }

  .main {
    padding-right: 34px;
    padding-left: 34px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .generator-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

@media (max-width: 980px) {
  :root {
    --sidebar-w: 0px;
  }

  .admin-shell {
    padding-left: 0;
  }

  .app-sidebar {
    display: none;
  }

  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 35;
    min-height: 64px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fffefa;
    background: var(--brand-900);
    box-shadow: 0 7px 22px rgba(47, 65, 53, .12);
  }

  .mobile-bar .brand {
    padding: 0;
  }

  .mobile-bar .brand-name small {
    display: none;
  }

  .mobile-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 9px 14px;
    background: #fffefa;
    border-bottom: 1px solid var(--line);
  }

  .mobile-nav .nav-link {
    min-height: 40px;
    padding: 0 12px;
    color: var(--ink-soft);
    white-space: nowrap;
  }

  .mobile-nav .nav-link:hover {
    color: var(--brand-900);
    background: var(--brand-050);
    transform: none;
  }

  .mobile-nav .nav-link.active {
    color: #fffefa;
    background: var(--brand-900);
    border-color: var(--brand-900);
    box-shadow: none;
  }

  .mobile-nav .nav-link.active::before {
    display: none;
  }

  .main {
    padding: 28px 20px 48px;
  }

  .dashboard-grid,
  .generator-layout {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
    min-height: auto;
  }

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-art {
    display: none;
  }

  .login-form-side {
    min-height: 100vh;
  }
}

/* Адаптация для телефонов. */
@media (max-width: 620px) {
  body {
    font-size: 14px;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .page-head h1 {
    font-size: 32px;
  }

  .header-actions,
  .header-actions > * {
    width: 100%;
  }

  .stat-grid,
  .quick-actions,
  .form-row,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 138px;
  }

  .panel-head {
    align-items: flex-start;
  }

  .panel-link {
    white-space: normal;
  }

  .mobile-nav .nav-link {
    gap: 8px;
    font-size: 12px;
  }

  .mobile-nav .nav-link i {
    width: 17px;
    font-size: 16px;
  }

  .login-form-side {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}


/* Финальная настройка плотности и использования широкого экрана. */
@media (min-width: 1281px) {
  .main {
    padding-right: clamp(40px, 4vw, 88px);
    padding-left: clamp(40px, 4vw, 88px);
  }

  .quick-actions {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  }

  .quick-action {
    max-width: none;
  }
}

/* Повышенный размер текста: интерфейс читаем и на большом мониторе. */
.data-table th {
  font-size: 11px;
}

.data-table td {
  font-size: 13px;
  line-height: 1.5;
}

.data-table small {
  font-size: 11px;
}

.stat-card .label {
  font-size: 13px;
}

.stat-card .meta {
  font-size: 12px;
}

.form-field label {
  font-size: 13px;
}

.input,
.filter-select {
  font-size: 14px;
}

.form-hint {
  font-size: 12px;
}

.panel-link,
.quick-action small,
.user-role {
  font-size: 12px;
}

.empty-state span {
  max-width: 460px;
  font-size: 13px;
}

@media (max-width: 980px) {
  .main {
    padding-right: 22px;
    padding-left: 22px;
  }
}

@media (max-width: 620px) {
  .main {
    padding-right: 15px;
    padding-left: 15px;
  }

  .data-table td {
    padding: 13px 12px;
    font-size: 12px;
  }

  .data-table th {
    padding: 11px 12px;
  }
}


/* Спокойная цветовая схема: светлая навигация и приглушённые синие акценты. */
:root {
  --brand-950: #39483d;
  --brand-900: #4a6550;
  --brand-800: #5c765f;
  --brand-700: #6f896f;
  --brand-600: #819981;
  --brand-100: #e7eee4;
  --brand-050: #f4f6f0;
  --canvas: #f5f5f0;
  --surface-soft: #f9f8f3;
  --surface-muted: #eef0e9;
  --ink: #303b33;
  --ink-soft: #626f63;
  --ink-faint: #7d877a;
  --line: #e2e6dd;
  --line-strong: #cdd5c8;
  --shadow-sm: 0 3px 12px rgba(47, 65, 53, .045);
  --shadow-md: 0 10px 28px rgba(47, 65, 53, .07);
}

.app-sidebar {
  color: #3e4c40;
  background: linear-gradient(180deg, #eff2eb, #e9eee5);
  border-right: 1px solid #e0e6dc;
  box-shadow: 5px 0 18px rgba(47, 65, 53, .035);
}

.brand-mark {
  color: #56725b;
  border-color: #a1b19a;
}

.brand-name {
  color: #405344;
}

.brand-name small {
  color: #657365;
}

.nav-link {
  color: #59695b;
}

.nav-link:hover {
  color: #3f5d43;
  background: rgba(95, 124, 98, .08);
}

.nav-link.active {
  color: #486749;
  background: #e2ebdf;
  border-color: #d7e2d3;
  box-shadow: none;
}

.nav-link.active::before {
  background: #819981;
}

.sidebar-foot {
  border-top-color: #d9e2d4;
}

.avatar {
  color: #4a6550;
  background: #e0e9dc;
}

.user-name {
  color: #405344;
}

.user-role {
  color: #657365;
}

.logout {
  color: #657365;
}

.logout:hover {
  color: #405344;
  background: rgba(95, 124, 98, .09);
}

.mobile-bar {
  background: #eff2eb;
}

.mobile-bar .brand-name {
  color: #405344;
}

@media (max-width: 980px) {
  .mobile-nav {
    background: #eff2eb;
  }

  .mobile-nav .nav-link.active {
    color: #486749;
    background: #e2ebdf;
    border-color: #d7e2d3;
  }
}


/* Вторичный текст в навигации остаётся спокойным, но достаточно контрастным. */
.brand-name small,
.user-role {
  color: #59695b;
}

.brand-name small {
  font-size: 10px;
}


/* Тихая палитра сохраняет разборчивость текста на светлых поверхностях. */
:root {
  --brand-700: #58755b;
  --ink-soft: #566457;
  --ink-faint: #59695b;
}

.input::placeholder {
  color: #606e60;
  opacity: 1;
}

.filter-select {
  color: var(--ink);
}

/* Пустая карточка не растягивается до высоты соседнего списка. */
.dashboard-grid-empty {
  align-items: start;
}

.dashboard-grid-empty > .panel {
  min-height: 0;
}

.dashboard-grid-empty .empty-state {
  min-height: 185px;
}

/* Служебные настройки QR не мешают обычному сценарию. */
.qr-advanced-settings {
  margin: 8px 0 18px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.qr-advanced-settings summary {
  padding: 13px 15px;
  color: var(--brand-700);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.qr-advanced-settings summary::-webkit-details-marker {
  display: none;
}

.qr-advanced-settings summary i {
  margin-right: 8px;
}

.qr-advanced-settings[open] summary {
  border-bottom: 1px solid var(--line);
}

.qr-advanced-content {
  padding: 16px 15px 0;
}

.qr-advanced-content > p {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 13px;
}

.qr-advanced-settings summary:focus-visible {
  outline: 3px solid rgba(86, 114, 91, .22);
  outline-offset: -3px;
}


@media (max-width: 620px) {
  .qr-advanced-content {
    padding: 14px 13px 0;
  }

  .qr-advanced-content .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
