:root {
  --bg: #eaf5ff;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --ink: #142033;
  --muted: #6d7b90;
  --line: #d8e7f6;
  --accent: #229ed9;
  --accent-dark: #1778b8;
  --accent-2: #2aabee;
  --cyan: #20c6d8;
  --soft: #e7f5ff;
  --soft-2: #f3f9ff;
  --danger: #d94b5f;
  --success: #0f9f75;
  --shadow: 0 24px 70px rgba(28, 88, 140, 0.16);
  --radius: 24px;
}

/* Предварительный просмотр обогащения документов базы знаний. */
.enrichment-modes {
    display: grid;
    gap: .55rem;
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--border, #d9dee8);
    border-radius: 12px;
}

.enrichment-modes label {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.enrichment-preview {
    margin: 1.25rem 0;
}

.preview-head,
.preview-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.enrichment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.enrichment-grid .wide {
    grid-column: 1 / -1;
}

.enrichment-warnings {
    margin: 1rem 0;
    padding: .85rem 1rem;
    color: #7a4b00;
    background: #fff6dc;
    border-radius: 10px;
}

.chunk-preview-list {
    display: grid;
    gap: .85rem;
}

.chunk-preview {
    padding: .85rem 1rem;
    border: 1px solid var(--border, #d9dee8);
    border-radius: 12px;
}

.chunk-preview summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
}

.chunk-source {
    max-height: 16rem;
    overflow: auto;
    padding: .85rem;
    white-space: pre-wrap;
    font: inherit;
    font-size: .88rem;
    background: rgba(127, 127, 127, .08);
    border-radius: 8px;
}

.preview-cancel {
    margin-top: .75rem;
}

@media (max-width: 760px) {
    .enrichment-grid {
        grid-template-columns: 1fr;
    }

    .enrichment-grid .wide {
        grid-column: auto;
    }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  padding-top: 70px;
  background:
    radial-gradient(circle at 18% 0%, rgba(42, 171, 238, 0.22), transparent 34%),
    linear-gradient(140deg, #f7fbff 0%, #eaf5ff 48%, #edf8fb 100%);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  color: #0d5d99;
}

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: rgba(248, 252, 255, 0.84);
  border-bottom: 1px solid rgba(210, 229, 247, 0.8);
  backdrop-filter: blur(18px);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 70px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-dark));
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(34, 158, 217, 0.25);
}

.nav-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-links,
.login-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a,
.login-links a,
.login-links button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  padding: 9px 13px;
}

.nav-links a:hover,
.login-links a:hover,
.login-links button:hover {
  color: var(--ink);
  background: rgba(34, 158, 217, 0.09);
}

.app-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 24px;
}

.app-footer {
  color: var(--muted);
  border-top: 1px solid rgba(210, 229, 247, 0.7);
  margin-top: 48px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-head h1,
.home-hero h1,
.auth-card h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  color: #103a63;
}

.page-head h1 {
  font-size: 38px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-hero {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
}

.hero-panel {
  width: min(780px, 100%);
  padding: clamp(34px, 8vw, 76px);
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.94), rgba(235,248,255,0.94)),
    var(--panel-solid);
  box-shadow: var(--shadow);
  text-align: center;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.hero-login-form { width: min(420px, 100%); display: grid; gap: 14px; margin: 30px auto 0; text-align: left; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.password-toggle:hover, .password-toggle:focus-visible { background: var(--soft); color: var(--accent-dark); }
.password-change-panel { display: grid; gap: 16px; margin-top: 20px; }

.panel,
.metric-card,
.machine-card,
.auth-card {
  background: var(--panel);
  border: 1px solid rgba(210, 229, 247, 0.82);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(29, 83, 132, 0.1);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
    margin-top: 20px;
}

.metric-card {
  padding: 22px;
  color: var(--ink);
  display: grid;
  gap: 10px;
  overflow: hidden;
}

.metric-card span {
  color: var(--muted);
  font-weight: 650;
}

.metric-card strong {
  font-size: 38px;
  line-height: 1;
  color: #0e78b7;
}

.metric-card.blue {
  background: linear-gradient(135deg, #ffffff, #e9f5ff);
}

.metric-card.cyan {
  background: linear-gradient(135deg, #ffffff, #e8fbfd);
}

.metric-card.attention {
  background: linear-gradient(135deg, #ffffff, #eaf3ff);
}

.dashboard-head {
  align-items: flex-end;
}

.dashboard-head .muted {
  margin: 10px 0 0;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.attention-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.attention-card {
  min-height: 96px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink);
  border: 1px solid rgba(210, 229, 247, 0.85);
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffff, #edf8ff);
  box-shadow: 0 16px 44px rgba(29, 83, 132, 0.11);
}

.attention-card.urgent {
  border-color: rgba(34, 158, 217, 0.34);
  background: linear-gradient(135deg, #ffffff, #e5f5ff);
}

.attention-card.calm {
  background: linear-gradient(135deg, #ffffff, #eefbf7);
}

.attention-card span {
  color: var(--muted);
  font-weight: 750;
}

    .attention-card strong {
        color: #0e78b7;
        font-size: 34px;
        line-height: 1;
        margin-right: 20px;
    }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
}

.dashboard-panel {
  min-height: 260px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-title-row h2 {
  margin: 0;
}

.dashboard-list {
  display: grid;
  gap: 10px;
}

.dashboard-machine-list {
  display: grid;
  gap: 12px;
}

.dashboard-machine-group {
  overflow: hidden;
  border: 1px solid rgba(210, 229, 247, 0.9);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 248, 255, 0.92));
  box-shadow: 0 12px 30px rgba(29, 83, 132, 0.08);
}

.dashboard-machine-group summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.dashboard-machine-group summary::-webkit-details-marker {
  display: none;
}

.dashboard-machine-group summary::after {
  content: "\203A";
  flex: 0 0 auto;
  color: #0e78b7;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.16s ease;
}

.dashboard-machine-group[open] summary::after {
  transform: rotate(90deg);
}

.dashboard-machine-title {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.dashboard-machine-title strong {
  overflow: hidden;
  color: #123a56;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-machine-title small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-list.nested {
  padding: 0 12px 12px;
}

.dashboard-row {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  color: var(--ink);
  border: 1px solid rgba(210, 229, 247, 0.78);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.dashboard-row:hover {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 12px 28px rgba(29, 83, 132, 0.1);
}

.dashboard-row.unread {
  border-color: rgba(34, 158, 217, 0.34);
  background: #edf8ff;
}

.dashboard-row strong {
  font-size: 15px;
}

.dashboard-row span:not(.unread-badge) {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-row .unread-badge.inline {
  position: absolute;
  top: 10px;
  right: 10px;
}

.quick-action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-action-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 10px 14px;
  color: #164568;
  font-weight: 750;
  border: 1px solid rgba(210, 229, 247, 0.85);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.quick-action-list a:hover {
  color: #0d5d99;
  background: #fff;
}

.menu-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: -4px 0 22px;
}

.menu-tile-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  min-height: 66px;
  padding: 16px 18px;
  border: 1px solid rgba(210, 229, 247, 0.9);
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff, #eef8ff);
  color: #164568;
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(29, 83, 132, 0.09);
}

.menu-tile-grid a:hover {
  color: #0d5d99;
  transform: translateY(-1px);
  box-shadow: 0 18px 44px rgba(29, 83, 132, 0.14);
}

.control-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.control-grid a,
.action-grid a,
.machine-card {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow-wrap: anywhere;
  padding: 20px;
  border: 1px solid rgba(210, 229, 247, 0.85);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  color: #164568;
  font-weight: 750;
  box-shadow: 0 12px 34px rgba(29, 83, 132, 0.08);
}

.control-grid a:hover,
.action-grid a:hover,
.machine-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 44px rgba(29, 83, 132, 0.14);
}

.client-machine-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 20px;
}

.machine-card.client-machine-card {
  display: grid;
  align-content: start;
  justify-content: stretch;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  text-align: left;
  color: var(--ink);
  background: linear-gradient(145deg, #ffffff 0%, #f0f8ff 100%);
}

.client-machine-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(210, 229, 247, 0.9);
}

.client-machine-card-head > div {
  min-width: 0;
}

.client-machine-mark {
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(135deg, #168fc8, #1b69bd);
  box-shadow: 0 10px 24px rgba(27, 105, 189, 0.24);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.client-machine-type {
  display: block;
  margin-bottom: 4px;
  color: #4b7693;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.machine-card.client-machine-card h2 {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  color: #123a56;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.16;
}

.client-machine-details {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 8px 22px 16px;
}

.client-machine-details > div {
  display: grid;
  grid-template-columns: minmax(105px, 0.8fr) minmax(0, 1.4fr);
  gap: 14px;
  align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px solid rgba(210, 229, 247, 0.72);
}

.client-machine-details > div:last-child {
  border-bottom: 0;
}

.client-machine-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.client-machine-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #173f5c;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.client-machine-serial {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.025em;
}

.client-machines-empty {
  text-align: center;
  color: var(--muted);
}

.client-machines-empty p {
  margin: 0;
}

.client-tickets-total {
  margin-bottom: 18px;
}

.client-ticket-machine-group {
  padding: 0;
  overflow: hidden;
}

.client-ticket-machine-group > .machine-summary {
  padding: 18px 22px;
}

.client-ticket-machine-group > .ticket-card-list {
  padding: 0 18px 18px;
}

.client-ticket-machine-group .accordion-chevron {
  display: inline-block;
  color: #0e78b7;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.16s ease;
}

.client-ticket-machine-group[open] .accordion-chevron {
  transform: rotate(180deg);
}

.client-tickets-empty {
  color: var(--muted);
  text-align: center;
}

.client-tickets-empty p {
  margin: 0;
}

.company-user-list {
  display: grid;
  gap: 12px;
}

.company-user-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  column-gap: 14px;
  row-gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(210, 229, 247, 0.9);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(240,248,255,0.9));
}

.company-user-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #168fc8, #1b69bd);
  font-size: 18px;
  font-weight: 900;
}

.company-user-identity {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.company-user-name-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  min-width: 0;
}

.company-user-current {
  flex: 0 0 auto;
  max-width: 100%;
  padding: 5px 9px;
  font-size: 10px;
  line-height: 1.15;
  white-space: normal;
}

.company-user-identity strong,
.company-user-identity span,
.company-user-identity small {
  overflow-wrap: anywhere;
}

.company-user-identity strong {
  color: #123a56;
  font-size: 15px;
}

.company-user-identity span,
.company-user-identity small {
  color: var(--muted);
  font-size: 12px;
}

.company-user-meta {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  margin: 0;
}

.company-user-meta div {
  min-width: 0;
}

.company-user-meta dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.company-user-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #173f5c;
  font-size: 12px;
  font-weight: 750;
}

.company-user-meta code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.company-user-actions,
.company-user-actions form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
}

.company-user-actions {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
}

.company-user-actions:empty {
  display: none;
}

.company-user-actions .btn-danger {
  width: auto;
  min-width: 92px;
  white-space: nowrap;
}

.qa-bulk-bar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:14px 0; }
.qa-bulk-bar label { margin:0; flex-direction:row; align-items:center; }
.qa-select-entry { flex:0 0 auto; width:18px; height:18px; margin-right:10px; }
.app-version { margin-left:8px; color:var(--muted); font-size:11px; }
.usage-donut-panel { display:grid; justify-items:center; gap:18px; }
.usage-donut { width:min(260px, 70vw); aspect-ratio:1; display:grid; place-items:center; border-radius:50%; background:conic-gradient(var(--usage-sectors)); position:relative; }
.usage-donut::after { content:""; position:absolute; inset:25%; border-radius:50%; background:white; }
.usage-donut span { z-index:1; font-size:20px; font-weight:850; color:#153e5b; }
.usage-legend { width:100%; display:grid; gap:8px; }
.usage-legend div { display:flex; justify-content:space-between; gap:12px; padding:9px 0; border-bottom:1px solid var(--line); }
.usage-legend-label { display:inline-flex; align-items:center; gap:9px; }
.usage-legend-color { flex:0 0 auto; width:12px; height:12px; border-radius:3px; background:var(--legend-color); box-shadow:0 0 0 1px rgba(15, 23, 42, .08); }
.usage-legend span { color:var(--muted); text-align:right; }

.split-layout,
.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 22px;
}

.panel {
  padding: 24px;
}

.panel.narrow,
.auth-card {
  max-width: 520px;
}

.panel h2,
.auth-card h1,
.machine-card h2 {
  margin: 0 0 18px;
  color: #154c73;
  font-size: 23px;
}

label {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 4px solid rgba(42, 171, 238, 0.16);
  border-color: var(--accent);
}

.btn-main,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  border-radius: 999px;
  padding: 11px 18px;
  border: 1px solid transparent;
  font-weight: 750;
  min-height: 44px;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease, filter .18s ease, transform .18s ease;
}

.btn-main {
    background: linear-gradient(135deg, var(--accent-2), var(--accent-dark));
    color: white;
    box-shadow: 0 14px 28px rgba(34, 158, 217, 0.24);
    margin-top: 20px;
}

.btn-main:hover {
  color: white;
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  border-color: var(--line);
  color: #174766;
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: #f5fbff;
  color: #0d5d99;
  box-shadow: 0 10px 22px rgba(29, 83, 132, 0.1);
  transform: translateY(-1px);
}

    .btn-secondary.small,
    .btn-danger {
        min-height: 36px;
        padding: 8px 13px;
        font-size: 13px;
        margin-bottom: 15px;
    }

.btn-danger,
.icon-danger {
  background: #fff2f4;
  border-color: #ffd4dc;
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid rgba(216, 231, 246, 0.85);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-weight: 750;
}

tr.new-assigned-ticket td {
  background: rgba(34, 158, 217, 0.08);
}

code {
  color: #136fa8;
  background: #eef8ff;
  border-radius: 999px;
  padding: 4px 8px;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.row-action {
  margin: 0;
}

.client-accounts-table {
  min-width: 1050px;
}

.employee-accounts-table {
  min-width: 1250px;
}

.operator-accounts-table {
  min-width: 1350px;
}

.client-accounts-table .table-actions,
.employee-accounts-table .table-actions,
.operator-accounts-table .table-actions {
  min-width: 210px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.client-accounts-table .table-actions .btn-secondary,
.client-accounts-table .table-actions .btn-danger,
.client-accounts-table .table-actions .row-action,
.client-accounts-table .table-actions .row-action button,
.employee-accounts-table .table-actions .btn-secondary,
.employee-accounts-table .table-actions .btn-danger,
.employee-accounts-table .table-actions .row-action,
.employee-accounts-table .table-actions .row-action button,
.operator-accounts-table .table-actions .btn-secondary,
.operator-accounts-table .table-actions .btn-danger,
.operator-accounts-table .table-actions .row-action,
.operator-accounts-table .table-actions .row-action button {
  width: auto;
  min-width: max-content;
  white-space: nowrap;
  overflow-wrap: normal;
}

.assign-form {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.assign-form select {
  min-height: 88px;
  border-radius: 18px;
}

.status-pill {
  display: inline-flex;
  border: 1px solid #cfe6f8;
  background: #f5fbff;
  border-radius: 999px;
  padding: 8px 12px;
  color: #226b97;
  white-space: nowrap;
  font-weight: 650;
}

.notification-menu {
  position: relative;
}

.notification-bell {
  position: relative;
  display: inline-grid;
  min-width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(210, 229, 247, 0.9);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 12px;
}

.notification-bell-icon {
  width: 22px;
  height: 22px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: 50% 10%;
}

.has-notifications .notification-bell {
  color: #e49a16;
  background: #fffaf0;
  border-color: rgba(228, 154, 22, .28);
}

.has-notifications .notification-bell-icon {
  animation: notification-ring 4.8s ease-in-out infinite;
}

@keyframes notification-ring {
  0%, 8% { transform: rotate(0); }
  10% { transform: rotate(18deg); }
  13% { transform: rotate(-16deg); }
  16% { transform: rotate(12deg); }
  19% { transform: rotate(-8deg); }
  22%, 100% { transform: rotate(0); }
}

.notification-dropdown {
  position: absolute;
  top: calc(100% - 2px);
  right: -8px;
  z-index: 40;
  width: min(360px, calc(100vw - 24px));
  max-height: min(480px, calc(100vh - 90px));
  padding: 10px;
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  border: 1px solid rgba(210, 229, 247, .95);
  border-radius: 18px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 22px 60px rgba(28, 88, 140, .24);
}

.notification-dropdown::before {
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 12px;
  content: "";
}

.notification-menu:hover .notification-dropdown,
.notification-menu:focus-within .notification-dropdown {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.notification-dropdown-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 10px;
  color: var(--ink);
  font-weight: 800;
}

.notification-dropdown-title strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12px;
}

.notification-chat-list {
  display: grid;
  gap: 6px;
}

.login-links .notification-chat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 13px;
  color: var(--ink);
}

.login-links .notification-chat-link:hover,
.login-links .notification-chat-link:focus-visible {
  color: var(--ink);
  background: var(--soft);
}

.notification-chat-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.notification-chat-main strong,
.notification-chat-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-chat-main strong {
  font-size: 14px;
}

.notification-chat-main small {
  color: var(--muted);
  font-size: 12px;
}

.notification-chat-count {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #18b56f;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.notification-empty {
  padding: 16px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.notification-bell strong,
.unread-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 26px;
  padding: 0 8px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #18b56f;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    0 0 0 5px rgba(24, 181, 111, .16),
    0 10px 26px rgba(24, 181, 111, .34);
}

@media (prefers-reduced-motion: reduce) {
  .has-notifications .notification-bell-icon {
    animation: none;
  }
}

.unread-badge.inline {
  position: absolute;
  top: 10px;
  right: 45px;
  flex: 0 0 auto;
}

.ticket-group-list {
  display: grid;
  gap: 18px;
}

.tickets-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.tickets-total-bar > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tickets-total-bar strong:not(.unread-badge) {
  color: #154c73;
  font-size: 24px;
}

.tickets-total-unread {
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(24, 181, 111, .08);
}

.ticket-client-group {
  padding: 0;
  overflow: hidden;
}

.ticket-client-group > summary,
.ticket-machine-group > summary {
  list-style: none;
}

.ticket-client-group > summary::-webkit-details-marker,
.ticket-machine-group > summary::-webkit-details-marker {
  display: none;
}

.ticket-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  cursor: pointer;
  user-select: none;
}

.ticket-accordion-summary h2,
.ticket-accordion-summary h3 {
  margin: 0;
  color: #154c73;
}

.ticket-summary-counts {
  display: flex;
  align-items: center;
  gap: 12px;
}

.accordion-chevron {
  color: #229ed9;
  font-size: 24px;
  line-height: 1;
  transition: transform .2s ease;
}

details[open] > .ticket-accordion-summary .accordion-chevron {
  transform: rotate(180deg);
}

.ticket-machine-list {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.ticket-machine-group {
  overflow: hidden;
  border: 1px solid rgba(210, 229, 247, 0.9);
  border-radius: 20px;
  background: rgba(245, 251, 255, 0.72);
}

.ticket-machine-group .machine-summary {
  padding: 15px 18px;
}

.ticket-machine-group > .ticket-card-list {
  padding: 0 14px 14px;
}

.ticket-group {
  display: grid;
  gap: 16px;
}

.ticket-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ticket-group-head h2 {
  margin: 0;
  color: #154c73;
}

.ticket-card-list {
  display: grid;
  gap: 12px;
}

.ticket-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(210, 229, 247, 0.86);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(29, 83, 132, 0.07);
}

.ticket-card-link:hover,
.ticket-card:hover {
  color: var(--ink);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 18px 44px rgba(29, 83, 132, 0.13);
}

.ticket-card.new-assigned-ticket {
  border-color: rgba(34, 158, 217, 0.35);
  background: #eef9ff;
}

.ticket-card-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-right: 24px;
}

.ticket-card-main h3 {
  margin: 0 0 6px;
  color: #123e62;
  font-size: 18px;
}

.ticket-card-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ticket-card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.ticket-card-meta > div {
  display: grid;
  gap: 8px;
  min-height: 64px;
  padding: 12px;
  border-radius: 18px;
  background: #f5fbff;
}

.ticket-card-meta strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.ticket-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.ticket-card .unread-badge {
  top: 10px;
  right: 10px;
  z-index: 2;
}

@media (max-width: 640px) {
  .tickets-total-bar,
  .ticket-accordion-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .tickets-total-bar > div,
  .ticket-summary-counts {
    width: 100%;
    justify-content: space-between;
  }
}

.chat-shell {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.message {
  max-width: 760px;
  border: 1px solid rgba(216, 231, 246, 0.9);
  border-radius: 24px 24px 24px 8px;
  background: white;
  padding: 15px 17px;
  box-shadow: 0 12px 30px rgba(29, 83, 132, 0.08);
}

.message.mine {
  margin-left: auto;
  color: white;
  background: linear-gradient(135deg, #2aabee, #229ed9);
  border-radius: 24px 24px 8px 24px;
}

.message.mine .message-meta {
  color: rgba(255,255,255,0.78);
}

.message.bot {
  border-color: #cfe6f8;
  background: #f4fbff;
}

.typing-message {
  width: fit-content;
  min-width: 150px;
}

.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 18px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  animation: typingPulse 1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

.typing-indicator {
  width: fit-content;
  margin: -4px 0 14px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 650;
}

.presence-pill {
  width: fit-content;
  margin: -4px 0 14px;
  padding: 9px 14px;
  border: 1px solid rgba(15, 159, 117, .2);
  border-radius: 999px;
  background: rgba(15, 159, 117, .1);
  color: #08775b;
  font-size: 13px;
  font-weight: 800;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.message-meta span:first-child {
  display: grid;
  gap: 2px;
}

.message-meta small {
  color: inherit;
  opacity: 0.78;
}

.message p {
  margin: 0;
  white-space: pre-wrap;
}

.message-translation {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(216, 231, 246, 0.88);
}

.message.mine .message-translation {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.message-translation span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.pending-translation p {
  color: var(--muted);
  font-style: italic;
}

.message.mine .message-translation span {
  color: rgba(255, 255, 255, 0.72);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 260px) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
  padding: 0 16px;
  border: 1px dashed #a9d8f3;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff, #eef9ff);
  color: #166d9e;
  cursor: pointer;
  font-weight: 750;
  text-align: center;
}

.file-picker:hover {
  border-color: var(--accent);
  background: #f5fbff;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.attachments a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  font-size: 13px;
}

.chat-image-button {
  display: block;
  width: min(260px, 72vw);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 12px 30px rgba(29, 83, 132, 0.14);
}

.chat-image-button img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(6, 22, 38, 0.86);
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox img {
  max-width: min(1200px, 96vw);
  max-height: 92vh;
  border-radius: 22px;
  object-fit: contain;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

.image-lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #123;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.inline-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 18px;
}

.qa-list-filter {
  grid-template-columns: minmax(180px, 1fr) minmax(110px, auto) auto;
}

.qa-search-filter {
  display: grid;
  gap: 10px;
  width: 100%;
}

.qa-filter-search-row,
.qa-filter-options-row {
  display: grid;
  align-items: end;
  gap: 10px;
}

.qa-filter-search-row {
  grid-template-columns: minmax(280px, 2fr) minmax(180px, 1fr) auto auto;
}

.qa-filter-options-row {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.qa-search-filter input,
.qa-search-filter select,
.qa-filter-search-row .btn-secondary {
  min-width: 0;
}

@media (max-width: 1180px) {
  .qa-filter-search-row,
  .qa-filter-options-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .qa-filter-search-row,
  .qa-filter-options-row {
    grid-template-columns: 1fr;
  }
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 7px 5px 13px;
  border-radius: 999px;
  background: #edf8ff;
  color: #155a84;
  font-weight: 700;
}

.category-item form {
  margin: 0;
}

.icon-danger {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #ffd4dc;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.inline-form {
  margin: 12px 0 22px;
}

.close-form {
  margin-top: 24px;
}

.notice {
  margin: 14px 0 0;
  color: var(--success);
}

.auth-layout {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.auth-card {
  width: 100%;
  padding: 30px;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent-dark);
  object-fit: cover;
  font-size: 13px;
  font-weight: 800;
}

.avatar-large {
  width: 84px;
  height: 84px;
  font-size: 28px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.profile-head h2,
.profile-head p {
  margin: 0;
}

.profile-head p,
.muted-text {
  color: var(--muted);
}

.muted-text {
  line-height: 1.6;
}

.profile-card {
  display: grid;
  gap: 18px;
}

.profile-details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.profile-details div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.profile-details dt {
  color: var(--muted);
  font-weight: 700;
}

.profile-details dd {
  margin: 0;
  font-weight: 700;
}

.profile-admin-layout {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(280px, .7fr) minmax(360px, 1.3fr);
  gap: 18px;
  align-items: start;
}

.operator-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 260px;
}

.operator-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(37, 99, 235, .16);
  background: rgba(37, 99, 235, .08);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.operator-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}

.operator-chip.more {
  background: rgba(15, 23, 42, .06);
  color: var(--muted);
}

.assign-inline-form {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.auth-card > a {
  display: inline-block;
  margin-top: 14px;
}

.check-line {
  display: flex;
  grid-template-columns: none;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.check-line input {
  width: auto;
}

.text-danger {
  margin-top: 12px;
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}

.knowledge-filter {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 10px;
  align-items: end;
  margin: 6px 0 14px;
}

.knowledge-filter label {
  margin: 0;
}

.knowledge-filter .btn-secondary {
  width: auto;
  min-width: 92px;
  justify-self: start;
}

.compact-form {
  grid-template-columns: minmax(120px, auto) minmax(160px, 1fr) auto;
}

.unread-row {
  background: rgba(37, 99, 235, 0.08);
}

.unread-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.muted-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.muted-link:hover {
  color: var(--accent-dark);
}

.notice-success {
  border: 1px solid rgba(34, 197, 94, .22);
  background: rgba(34, 197, 94, .1);
  color: #166534;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 700;
}

.notice-error {
  border: 1px solid rgba(239, 68, 68, .22);
  background: rgba(239, 68, 68, .1);
  color: #991b1b;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 700;
}

.as-link {
  text-decoration: none;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.qa-template {
  margin-top: 18px;
  border: 1px solid rgba(37, 99, 235, .14);
  background: linear-gradient(180deg, rgba(239, 246, 255, .95), rgba(255, 255, 255, .98));
  border-radius: 18px;
  padding: 16px;
}

.qa-template h3 {
  color: #1d4ed8;
  font-size: 16px;
  margin: 0 0 10px;
}

.qa-template pre {
  white-space: pre-wrap;
  margin: 0;
  color: #334155;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
}

.qa-editor textarea {
  min-height: 92px;
}

.qa-list {
  display: grid;
  gap: 14px;
}

.qa-model-group {
  overflow: hidden;
  border: 1px solid rgba(14, 120, 183, .2);
  border-radius: 22px;
  background: #f7fbff;
  box-shadow: 0 12px 30px rgba(29, 83, 132, .08);
}

.qa-group-summary {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) max-content 20px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

.qa-group-summary::-webkit-details-marker {
  display: none;
}

.qa-group-summary::after {
  content: "\203A";
  grid-column: 4;
  color: #0e78b7;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  transition: transform .16s ease;
}

.qa-model-group[open] > .qa-model-summary::after,
.qa-serial-group[open] > .qa-serial-summary::after {
  transform: rotate(90deg);
}

.qa-group-summary strong {
  min-width: 0;
  overflow: hidden;
  color: #123a56;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qa-group-summary > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.qa-select-group {
  width: 18px;
  height: 18px;
  margin: 0;
}

.qa-model-summary {
  background: linear-gradient(135deg, #edf8ff, #f8fcff);
}

.qa-model-group-body {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid rgba(14, 120, 183, .12);
}

.qa-serial-group {
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, .12);
  border-radius: 18px;
  background: #fff;
}

.qa-serial-summary {
  min-height: 48px;
  padding: 10px 14px;
  background: #f9fbff;
}

.qa-serial-summary strong {
  font-size: 14px;
}

.qa-group-entries {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(37, 99, 235, .1);
}

.qa-group-entries > .qa-card {
  box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
}

.qa-card {
  border: 1px solid rgba(37, 99, 235, .12);
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

.qa-compact-card {
  padding: 0;
  overflow: hidden;
}

.qa-card-summary {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) max-content 20px;
  align-items: center;
  column-gap: 12px;
  min-height: 68px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.qa-card-summary::-webkit-details-marker {
  display: none;
}

.qa-card-summary::after {
  content: "\203A";
  flex: 0 0 auto;
  color: #0e78b7;
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
  transition: transform .16s ease;
  grid-column: 4;
  grid-row: 1;
}

.qa-compact-card[open] .qa-card-summary {
  border-bottom: 1px solid rgba(37, 99, 235, .1);
  background: #f8fbff;
}

.qa-compact-card[open] .qa-card-summary::after {
  transform: rotate(90deg);
}

.qa-summary-main {
  display: flex;
  grid-column: 2;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.qa-summary-main strong {
  overflow: hidden;
  color: #123a56;
  font-size: 15px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qa-summary-meta {
  display: flex;
  grid-column: 3;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.qa-select-entry { margin: 0; }
.qa-summary-meta time { min-width: 128px; text-align: right; }

.qa-card-body {
  padding: 0 16px 16px;
}

.indexed-chat-body h3 {
  margin: 16px 0 8px;
  color: #154c73;
  font-size: 16px;
}

.indexed-chat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.bot-test-form textarea {
  min-height: 120px;
}

.bot-test-result .chat-bubble {
  max-width: 960px;
}

.bot-test-debug h3 {
  margin: 22px 0 10px;
  color: #154c73;
}

.debug-pre {
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7fbff;
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 16px;
  padding: 14px;
  color: #24364f;
  font-size: 13px;
  line-height: 1.5;
}

.indexed-chunk-list {
  margin-top: 14px;
}

.indexed-chunk {
  border: 1px solid rgba(37, 99, 235, .12);
  border-radius: 16px;
  background: #f8fbff;
  padding: 10px 12px;
}

.indexed-chunk + .indexed-chunk {
  margin-top: 10px;
}

.indexed-chunk-text {
  max-height: 360px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 14px;
  background: #0f172a;
  color: #e5eefb;
  white-space: pre-wrap;
  font: 13px/1.55 Consolas, "Segoe UI Mono", monospace;
}

.qa-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.qa-card h3 {
  margin: 10px 0 0;
  color: #1e3a8a;
  font-size: 18px;
}

.qa-answer {
  margin-top: 14px;
  padding: 14px;
  white-space: pre-wrap;
  color: #1f2937;
  background: #f8fafc;
  border-radius: 16px;
  line-height: 1.55;
}

.qa-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}

.qa-meta div {
  background: #eff6ff;
  border-radius: 14px;
  padding: 10px 12px;
}

.qa-meta dt {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.qa-meta dd {
  color: #0f172a;
  margin: 0;
  font-weight: 700;
}

.qa-details {
  margin-top: 12px;
  color: #334155;
}

.qa-details summary {
  cursor: pointer;
  color: #2563eb;
  font-weight: 800;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.form-actions > .btn-main,
.form-actions > .btn-secondary,
.form-actions > .btn-danger {
  position: relative;
  margin-top: 0;
}

.machines-admin-page {
  display: grid;
  gap: 16px;
}

.machine-create-panel h2,
.machine-list-panel h2 {
  margin-bottom: 12px;
}

.machine-create-grid {
  display: grid;
  grid-template-columns: 1fr .8fr .9fr 1.2fr auto;
  gap: 10px;
  align-items: end;
}

.machine-create-grid label {
  margin: 0;
}

.machine-create-grid input {
  min-width: 0;
}

.machine-admin-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
}

.machine-admin-list {
  display: grid;
  gap: 8px;
  min-width: 860px;
}

.machine-admin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(37, 99, 235, .12);
  background: #fff;
  border-radius: 14px;
  padding: 8px;
}

.machine-admin-form {
  display: grid;
  grid-template-columns: 1.15fr .8fr .95fr 1.35fr 112px 90px;
  gap: 8px;
  align-items: center;
}

.machine-admin-form label {
  gap: 4px;
  margin: 0;
  min-width: 0;
}

.machine-admin-form label span,
.machine-admin-status span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.machine-admin-form input {
  min-width: 0;
  padding: 7px 9px;
  font-size: 13px;
}

.machine-admin-status {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 12px;
  background: #eff6ff;
}

.machine-admin-status strong {
  color: #1d4ed8;
  font-size: 12px;
  white-space: nowrap;
}

.machine-delete-form {
  margin: 0;
}

.machine-row-button {
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.1;
  min-height: 34px;
  white-space: nowrap;
}

.time-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.api-statistics-filter {
  justify-content: center;
}

.api-statistics-filter .btn-secondary {
  min-height: 42px;
  width: 100%;
}

.api-statistics-period {
    margin: 10px 0 10px;
    text-align: center;
}

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
  font-size: 13px;
}

.bar-label span {
  color: #64748b;
  white-space: nowrap;
}

.bar-track {
  position: relative;
  min-height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.bar-fill {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.bar-fill.cyan {
  background: linear-gradient(90deg, #0891b2, #22d3ee);
}

.bar-fill.overtime {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(90deg, #f97316, #fb7185);
  opacity: .9;
}

.overtime-row td {
  background: #fff7ed;
}

.video-card {
  display: grid;
  gap: 8px;
  max-width: 520px;
}

.video-card video {
  width: 100%;
  max-height: 340px;
  border-radius: 16px;
  background: #0f172a;
}

.video-card span {
  color: #64748b;
  font-size: 12px;
}

.video-state {
  display: grid;
  min-height: 120px;
  place-items: center;
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 16px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
}

.video-state.failed {
  border-color: rgba(239, 68, 68, .18);
  background: #fef2f2;
  color: #b91c1c;
}

.video-progress-box {
  display: grid;
  gap: 10px;
  width: min(100%, 360px);
  padding: 18px;
  text-align: center;
}

.video-progress-box strong {
  color: #1d4ed8;
  font-size: 14px;
}

.video-progress-box small {
  color: #475569;
  font-weight: 800;
}

.video-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(37, 99, 235, .13);
}

.video-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  transition: width .25s ease;
}

.message-meta-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.message-delete-form {
  display: inline-flex;
  margin: 0;
}

.message-delete-form button {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, .08);
  color: #64748b;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.message-delete-form button:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: scale(1.04);
}

.delete-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(8px);
}

.delete-confirm-modal[hidden] {
  display: none;
}

.delete-confirm-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  width: min(100%, 430px);
  padding: 22px;
  border: 1px solid rgba(239, 68, 68, .14);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .22);
}

.delete-confirm-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.delete-confirm-card h2 {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 20px;
}

.delete-confirm-card p {
  margin: 0;
  color: #64748b;
}

.delete-confirm-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.avatar-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(10px);
}

.avatar-crop-modal[hidden] {
  display: none;
}

.avatar-crop-card {
  width: min(100%, 620px);
  padding: 22px;
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .24);
}

.avatar-crop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.avatar-crop-head h2 {
  margin: 0 0 6px;
  color: #0f3f69;
  font-size: 23px;
}

.avatar-crop-head p {
  margin: 0;
  color: var(--muted);
}

.avatar-crop-close {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #eef8ff;
  color: #175f91;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.avatar-crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1.35 / 1;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 24px;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, .18) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, .18) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, .18) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, .18) 75%),
    #f8fafc;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.avatar-crop-stage:active {
  cursor: grabbing;
}

.avatar-crop-stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  transform-origin: center center;
  will-change: transform;
}

.avatar-crop-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at center,
    transparent 0 35.8%,
    rgba(15, 23, 42, .42) 36% 100%);
}

.avatar-crop-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72%;
  aspect-ratio: 1;
  border: 3px dashed rgba(255, 255, 255, .96);
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, .18),
    0 18px 60px rgba(15, 23, 42, .16);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.avatar-crop-zoom {
  margin: 16px 0 0;
}

.avatar-crop-zoom input {
  accent-color: var(--accent);
}

.avatar-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.qa-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.qa-media-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.qa-media-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(37, 99, 235, .12);
  border-radius: 16px;
  background: #f8fafc;
}

.qa-media-item img,
.qa-media-item video {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  background: #0f172a;
}

.qa-media-item span {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .machine-create-grid {
    grid-template-columns: 1fr 1fr;
  }

  .time-filter {
    grid-template-columns: 1fr 1fr;
  }

  .api-statistics-filter .btn-secondary {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(220px, 100%);
  }

  .machine-admin-scroll {
    margin-inline: -4px;
  }
}

@media (max-width: 800px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    padding-top: 78px;
    background:
      radial-gradient(circle at 18% 0%, rgba(42, 171, 238, 0.16), transparent 36%),
      linear-gradient(140deg, #f7fbff 0%, #eaf5ff 54%, #edf8fb 100%);
  }

  main,
  .app-container,
  .panel,
  .auth-card,
  .metric-card,
  .machine-card,
  .dashboard-panel,
  .ticket-card,
  .qa-card,
  .message {
    min-width: 0;
  }

  .app-container {
    padding: 18px 12px;
  }

  .app-footer {
    margin-top: 24px;
  }

  .top-nav {
    max-width: 100vw;
  }

  .nav-inner {
    min-height: 58px;
    padding: 8px 12px;
    gap: 8px;
  }

  .nav-content {
    min-width: 0;
    gap: 8px;
  }

  .brand {
    min-height: 34px;
    max-width: 196px;
    padding: 0 12px;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-links,
  .login-links {
    flex-direction: row;
    gap: 4px;
  }

  .nav-links a,
  .login-links a,
  .login-links button {
    padding: 7px 9px;
    font-size: 13px;
    white-space: nowrap;
  }

  .login-links {
    max-width: 100%;
    overflow: visible;
  }

  .notification-dropdown {
    position: fixed;
    top: 58px;
    right: 12px;
    width: min(360px, calc(100vw - 24px));
  }

  .profile-link {
    gap: 0;
  }

  .profile-link > span:not(.avatar) {
    display: none;
  }

  .notification-bell {
    min-width: 34px;
    height: 34px;
  }

  .notification-bell strong {
    top: -5px;
    right: -5px;
  }

  .page-head,
  .dashboard-head {
    gap: 12px;
    margin-bottom: 16px;
  }

  .page-head h1,
  .home-hero h1,
  .auth-card h1 {
    font-size: 28px;
    line-height: 1.12;
  }

  .eyebrow {
    margin-bottom: 6px;
    font-size: 11px;
  }

  .home-hero {
    min-height: calc(100vh - 150px);
  }

  .hero-panel,
  .panel,
  .auth-card,
  .metric-card,
  .machine-card,
  .qa-card {
    border-radius: 20px;
  }

  .hero-panel,
  .panel,
  .auth-card {
    padding: 18px;
  }

  .hero-actions,
  .dashboard-actions,
  .page-actions,
  .form-actions,
  .delete-confirm-actions,
  .avatar-crop-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .btn-main,
  .hero-actions .btn-secondary,
  .dashboard-actions .btn-main,
  .dashboard-actions .btn-secondary,
  .page-actions .btn-main,
  .page-actions .btn-secondary,
  .form-actions .btn-main,
  .form-actions .btn-secondary,
  .form-actions .btn-danger,
  .delete-confirm-actions .btn-main,
  .delete-confirm-actions .btn-secondary,
  .avatar-crop-actions .btn-main,
  .avatar-crop-actions .btn-secondary {
    width: 100%;
  }

  .metric-grid,
  .attention-strip,
  .dashboard-grid,
  .menu-tile-grid,
  .control-grid,
  .card-grid,
  .qa-meta,
  .qa-media-grid,
  .qa-media-grid.compact {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .metric-card {
    padding: 16px;
  }

  .metric-card strong,
  .attention-card strong {
    font-size: 30px;
  }

  .attention-card {
    min-height: 78px;
    padding: 16px;
    border-radius: 20px;
  }

  .panel-title-row,
  .qa-card-head,
  .profile-head,
  .ticket-group-head,
  .ticket-card-main,
  .ticket-card-meta,
  .ticket-card-actions,
  .message-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .menu-tile-grid a,
  .control-grid a,
  .action-grid a,
  .machine-card {
    min-height: 54px;
    padding: 14px 16px;
    border-radius: 18px;
  }

  .client-machine-details > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .client-ticket-machine-group > .machine-summary {
    padding: 14px 16px;
  }

  .client-ticket-machine-group > .ticket-card-list {
    padding: 0 10px 10px;
  }

  .company-user-card {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .company-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .company-user-meta {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 10px;
    border-top: 1px solid rgba(210, 229, 247, 0.72);
  }

  .company-user-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .company-user-actions .btn-danger {
    min-width: 0;
  }

  .client-machine-card-head {
    padding: 18px;
  }

  .client-machine-details {
    padding-inline: 18px;
  }

  .dashboard-machine-group {
    border-radius: 18px;
  }

  .dashboard-machine-group summary {
    min-height: 58px;
    padding: 12px 14px;
  }

  .dashboard-list.nested {
    padding: 0 8px 8px;
  }

  .dashboard-row {
    padding: 12px 42px 12px 12px;
    border-radius: 16px;
  }

  .dashboard-row strong,
  .dashboard-row span,
  .qa-summary-main strong,
  .ticket-card-main h3,
  .ticket-card-main p {
    overflow-wrap: anywhere;
  }

  .split-layout,
  .knowledge-layout,
  .profile-admin-layout,
  .settings-layout,
  .chat-form,
  .knowledge-filter,
  .time-filter,
  .machine-create-grid,
  .assign-inline-form,
  .compact-form,
  .inline-grid {
    grid-template-columns: 1fr;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-inner,
  .nav-content,
  .nav-links,
  .login-links {
    align-items: center;
  }

  .table-actions {
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
  }

  .table-actions .btn-main,
  .table-actions .btn-secondary,
  .table-actions .btn-danger,
  .row-action,
  .row-action button,
  .assign-form,
  .assign-inline-form .btn-secondary {
    width: 100%;
  }

  .table-wrap,
  .machine-admin-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    min-width: 680px;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 13px;
  }

  input,
  select,
  textarea,
  button {
    max-width: 100%;
  }

  input,
  select,
  textarea {
    border-radius: 16px;
    padding: 11px 12px;
  }

  label {
    margin-bottom: 12px;
  }

  .knowledge-filter .btn-secondary {
    width: 100%;
  }

  .inline-add {
    grid-template-columns: 1fr;
  }

  .qa-card-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    padding: 12px 42px 12px 12px;
    position: relative;
  }

  .qa-card-summary::after {
    position: absolute;
    top: 16px;
    right: 14px;
  }

  .qa-summary-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    width: 100%;
  }

  .qa-summary-main strong {
    white-space: normal;
  }

  .qa-summary-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    white-space: normal;
  }

  .qa-card-body {
    padding: 0 12px 12px;
  }

  .indexed-chat-grid {
    grid-template-columns: 1fr;
  }

  .indexed-chunk-text {
    max-height: 280px;
    font-size: 12px;
  }

  .ticket-group {
    border-radius: 20px;
  }

  .ticket-card {
    padding: 14px;
    border-radius: 18px;
  }

  .ticket-card-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .operator-chip-list {
    max-width: 100%;
  }

  .chat-shell {
    gap: 10px;
  }

  .message {
    width: fit-content;
    max-width: 92vw;
    padding: 13px 14px;
    border-radius: 20px 20px 20px 8px;
  }

  .message.mine {
    border-radius: 20px 20px 8px 20px;
  }

  .message p,
  .message-translation {
    overflow-wrap: anywhere;
  }

  .chat-form {
    gap: 10px;
    align-items: stretch;
  }

  .chat-form .btn-main,
  .file-picker {
    width: 100%;
  }

  .file-picker {
    min-height: 44px;
    border-radius: 16px;
  }

  .chat-image-button {
    width: min(100%, 300px);
  }

  .attachments a {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-details div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .machine-admin-list {
    min-width: 760px;
  }

  .machine-admin-form {
    grid-template-columns: 1fr .85fr .95fr 1.2fr 96px 78px;
  }

  .avatar-crop-modal {
    padding: 12px;
  }

  .avatar-crop-card {
    padding: 16px;
    border-radius: 22px;
  }

  .avatar-crop-stage {
    min-height: 260px;
    border-radius: 18px;
  }

  .avatar-crop-head h2 {
    font-size: 20px;
  }

  .delete-confirm-card {
    width: min(100%, 360px);
    padding: 18px;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 64px;
  }

  .nav-inner {
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    min-height: 58px;
  }

  .nav-content {
    width: auto;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-content::-webkit-scrollbar {
    display: none;
  }

  .brand {
    flex: 0 0 auto;
    max-width: 158px;
  }

  .nav-links {
    flex: 0 0 auto;
  }

  .login-links {
    flex: 0 0 auto;
    justify-content: flex-start;
  }

  .page-head h1,
  .home-hero h1,
  .auth-card h1 {
    font-size: 25px;
  }

  .panel h2,
  .auth-card h1,
  .machine-card h2 {
    font-size: 20px;
  }

  .btn-main,
  .btn-secondary,
  .btn-danger {
    min-height: 42px;
    padding: 10px 14px;
  }

  .message {
    max-width: calc(100vw - 24px);
  }

  .avatar-crop-stage {
    min-height: 230px;
  }
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
/* Production calendar */
.calendar-settings { margin-bottom: 22px; }
.form-inline { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.form-inline label { margin: 0; }
.form-inline input[type="number"] { width: 120px; }
.calendar-preview { margin: 22px 0; border-color: #9ed7bf; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.calendar-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; }
.year-calendar { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 18px; }
.month-calendar { border: 1px solid var(--line, #d9e8f4); border-radius: 16px; padding: 14px; }
.month-calendar h3 { margin: 0 0 10px; text-transform: capitalize; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.month-grid.weekdays { color: var(--muted, #71839b); font-size: 12px; margin-bottom: 4px; }
.calendar-day { min-height: 29px; padding: 6px 2px; border-radius: 7px; font-size: 12px; cursor: default; }
.day-working { background: #eef7ff; }
.day-weekend { background: #ffe9ec; color: #a63b50; }
.day-holiday { background: #ffd5dc; color: #8d1830; font-weight: 700; }
.day-shortened { background: #fff0bd; color: #765a00; }
