:root {
  --bg: #f3f4f1;
  --surface: #fbfcfa;
  --surface-strong: #ffffff;
  --surface-soft: #f7f8f4;
  --text: #111312;
  --muted: #68706b;
  --faint: #9ca49f;
  --line: rgba(17, 19, 18, 0.1);
  --line-soft: rgba(17, 19, 18, 0.06);
  --accent: #4169f4;
  --accent-dark: #2f50c8;
  --accent-soft: #eef3ff;
  --danger: #c7372f;
  --danger-soft: #ffe5e2;
  --warning: #4b5f9b;
  --warning-soft: #eef3ff;
  --ok: #2f50c8;
  --ok-soft: #eef3ff;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px rgba(25, 31, 43, 0.08);
  --shadow-soft: 0 8px 22px rgba(25, 31, 43, 0.06);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.shell,
.layout,
.content,
.panel,
.entity-card,
.history-card,
.metric-card,
.report-line,
.report-builder {
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 84% 8%, rgba(255, 255, 255, 0.92) 0 120px, transparent 310px),
    linear-gradient(180deg, #f8f9fb 0%, #f3f5f8 42%, #eef1f5 100%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

::selection {
  color: #fff;
  background: var(--accent);
}

:focus-visible {
  outline: 3px solid rgba(65, 105, 244, 0.2);
  outline-offset: 2px;
}

.shell {
  position: relative;
  min-height: 100vh;
}

.shell::before {
  content: "";
  position: fixed;
  top: 96px;
  right: -100px;
  z-index: -1;
  width: 330px;
  height: 330px;
  border-radius: 78px;
  background:
    radial-gradient(circle at 74% 22%, #fff 0 10%, transparent 11%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(190, 200, 202, 0.32));
  box-shadow:
    inset 28px 28px 70px rgba(255, 255, 255, 0.88),
    inset -34px -28px 80px rgba(90, 105, 108, 0.16),
    0 48px 130px rgba(64, 78, 76, 0.14);
  transform: rotate(18deg);
  pointer-events: none;
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 10px 18px 10px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(251, 252, 250, 0.82);
  backdrop-filter: blur(22px) saturate(1.25);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 30px;
  flex: 0 0 42px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(65, 105, 244, 0.22);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(238, 243, 255, 0.86);
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.92);
  font-size: 10px;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 760;
  line-height: 1.05;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.layout {
  display: block;
  min-height: 100vh;
  padding-top: 60px;
  padding-left: 86px;
}

.sidebar {
  position: fixed;
  top: 60px;
  bottom: 0;
  left: 0;
  z-index: 20;
  width: 86px;
  height: auto;
  padding: 12px 8px;
  border-right: 1px solid var(--line-soft);
  background: rgba(251, 252, 250, 0.78);
  backdrop-filter: blur(22px) saturate(1.2);
}

.nav {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  width: 70px;
  min-height: 50px;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
}

.nav button.active {
  color: var(--text);
  border-color: var(--line);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.nav-icon {
  position: relative;
  display: inline-grid;
  width: 17px;
  height: 17px;
  place-items: center;
  flex: 0 0 17px;
}

.nav-label {
  position: static;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  font-size: 9px;
  font-weight: 760;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav button:hover .nav-label {
  display: block;
}

.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  border: 1.7px solid currentColor;
  border-radius: 5px;
}

.icon-home::before { width: 14px; height: 10px; transform: translateY(2px); }
.icon-home::after { width: 8px; height: 8px; border-right: 0; border-bottom: 0; transform: translateY(-4px) rotate(45deg); }
.icon-check::before { width: 14px; height: 14px; }
.icon-check::after { width: 8px; height: 4px; border-top: 0; border-right: 0; border-radius: 0; transform: rotate(-45deg); }
.icon-spark::before { width: 14px; height: 14px; border-radius: 3px; transform: rotate(45deg) scale(0.78); }
.icon-team::before { width: 7px; height: 7px; border-radius: 50%; transform: translate(-4px, -4px); }
.icon-team::after { width: 14px; height: 7px; border-radius: 8px 8px 4px 4px; transform: translateY(5px); }
.icon-box::before { width: 16px; height: 13px; border-radius: 3px; transform: translateY(2px); }
.icon-box::after { width: 10px; height: 10px; border-right: 0; border-bottom: 0; border-radius: 2px 0 0 0; transform: translateY(-3px) rotate(45deg); }
.icon-chart::before { width: 14px; height: 14px; border-top: 0; border-right: 0; border-radius: 0; }
.icon-chart::after { width: 8px; height: 8px; border-left: 0; border-bottom: 0; border-radius: 0; transform: translate(3px, -3px); }
.icon-tasks::before { width: 14px; height: 16px; border-radius: 4px; }
.icon-tasks::after { width: 8px; height: 4px; border-top: 0; border-right: 0; border-radius: 0; transform: translate(1px, -1px) rotate(-45deg); }
.icon-clock::before { width: 14px; height: 14px; border-radius: 50%; }
.icon-clock::after { width: 5px; height: 6px; border-top: 0; border-right: 0; border-radius: 0; transform: translate(2px, -1px); }
.icon-voice::before { width: 9px; height: 13px; border-radius: 8px; }
.icon-voice::after { width: 15px; height: 9px; border-top: 0; border-radius: 0 0 8px 8px; transform: translateY(3px); }
.icon-wallet::before { width: 15px; height: 11px; }
.icon-wallet::after { width: 5px; height: 5px; border-radius: 50%; transform: translate(5px, 1px); }
.icon-warn::before { width: 15px; height: 15px; border-radius: 3px; transform: rotate(45deg); }
.icon-warn::after { width: 2px; height: 8px; border-right: 0; border-bottom: 0; border-top: 0; transform: translateY(-1px); }
.icon-list::before { width: 15px; height: 13px; border-radius: 3px; }
.icon-list::after { width: 9px; height: 7px; border-right: 0; border-left: 0; border-radius: 0; }

.content {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 26px clamp(14px, 3vw, 28px) 56px;
}

.admin-menu-backdrop {
  display: none;
}

.admin-menu-panel {
  position: fixed;
  top: 60px;
  bottom: 0;
  left: 0;
  z-index: 80;
  width: min(318px, calc(100vw - 24px));
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-left: 0;
  border-radius: 0 24px 24px 0;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.2);
  animation: drawerIn 0.18s ease-out;
}

@keyframes drawerIn {
  from { transform: translateX(-16px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.admin-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-menu-head div {
  display: grid;
  gap: 3px;
}

.admin-menu-head b {
  font-size: 18px;
}

.admin-menu-head span {
  color: var(--muted);
  font-size: 13px;
}

.icon-btn {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--text);
  background: #fff;
  font-size: 20px;
  font-weight: 700;
}

.admin-menu-grid {
  display: grid;
  gap: 8px;
}

.admin-menu-grid button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(248, 249, 251, 0.78);
  font-weight: 760;
  text-align: left;
}

.admin-menu-grid button.active {
  border-color: rgba(65, 105, 244, 0.24);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.view-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-kicker,
.focus-label {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.view-title h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(32px, 6vw, 58px);
  font-weight: 780;
  line-height: 0.96;
}

.view-title h3,
.panel h3,
.card h3,
.review-board h3 {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 760;
}

.view-title p {
  max-width: 700px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.card,
.focus-panel,
.review-board,
.metric-card,
.history-card,
.entity-card,
.login-box {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.panel,
.card {
  padding: 20px;
}

.focus-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 22px;
  align-items: center;
  padding: 26px;
  border-color: rgba(65, 105, 244, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 243, 255, 0.78));
  box-shadow: var(--shadow);
}

.focus-panel h3 {
  margin: 0;
  font-size: clamp(28px, 4.6vw, 46px);
  line-height: 1.02;
}

.focus-panel p {
  max-width: 700px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.focus-action {
  display: grid;
  gap: 12px;
}

.stat {
  display: grid;
  gap: 12px;
  min-height: 112px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  font-size: 34px;
  line-height: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  min-width: 148px;
  padding: 10px 16px;
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-soft);
  font-size: 14px;
  font-weight: 760;
}

.btn.primary {
  color: #fff;
  background: var(--accent);
}

.btn.danger {
  color: #fff;
  background: var(--danger);
}

.btn.ghost,
.btn.voice-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.hero-btn {
  width: 100%;
  min-height: 54px;
  font-size: 16px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.focus-panel .actions .btn,
.view-title > .btn {
  min-width: 170px;
}

.form,
.quick-entry,
.assistant-composer {
  display: grid;
  gap: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  outline: 0;
}

textarea {
  min-height: 106px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(65, 105, 244, 0.13);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.badge,
.risk-chip,
.ok-chip,
.mini-metrics span,
.entity-meta span,
.rate-row span,
.rate-row b {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 5px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 760;
}

.badge {
  color: var(--muted);
  background: var(--surface-soft);
}

.badge.ok,
.ok-chip {
  color: var(--ok);
  background: var(--ok-soft);
}

.badge.warn {
  color: var(--warning);
  background: var(--warning-soft);
}

.badge.danger,
.risk-chip {
  color: var(--danger);
  background: var(--danger-soft);
}

.money {
  font-weight: 820;
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.empty,
.notice,
.panel-lite,
.quick-entry,
.calc-box,
.report-line,
.shift-report-comments,
.shift-system-review {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.empty,
.notice,
.panel-lite,
.quick-entry,
.calc-box,
.shift-report-comments,
.shift-system-review {
  padding: 14px;
}

.notice.warn {
  border-color: rgba(65, 105, 244, 0.22);
  background: var(--warning-soft);
}

.hidden {
  display: none;
}

.review-board {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.review-board-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.review-board-head p,
.review-main p,
.entity-card p,
.metric-card p,
.history-card p {
  margin: 5px 0 0;
  color: var(--muted);
}

.review-cards,
.entity-grid,
.metric-grid,
.history-list {
  display: grid;
  gap: 12px;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.product-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.report-catalog-admin {
  margin-top: 18px;
}

.report-catalog-form {
  margin-bottom: 16px;
}

.report-catalog-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.report-catalog-card.is-archived {
  opacity: 0.62;
}

.report-catalog-card .muted {
  font-size: 12px;
  font-weight: 760;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head p,
.analytics-section > p {
  margin: 5px 0 0;
  color: var(--muted);
}

.review-card {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(180px, 1fr) 140px auto;
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
}

.review-card.attention {
  border-color: rgba(199, 55, 47, 0.28);
  background: #fffafa;
}

.review-main,
.review-title,
.entity-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-title {
  flex-wrap: wrap;
}

.review-title h4,
.entity-card h4,
.metric-card h4,
.history-card h4 {
  margin: 0;
}

.avatar,
.assistant-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--text);
  font-size: 13px;
  font-weight: 820;
}

.review-signal,
.review-total {
  display: grid;
  gap: 5px;
}

.review-signal > span,
.review-total > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.review-total strong,
.metric-card strong,
.history-card strong {
  font-size: 24px;
}

.entity-card,
.metric-card,
.history-card {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 15px;
  background: #fff;
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  transform: translateY(-1px);
  border-color: rgba(67, 102, 240, 0.28);
}

.entity-card > *,
.history-card > *,
.metric-card > * {
  min-width: 0;
}

.entity-meta,
.rate-row,
.mini-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.entity-meta span,
.rate-row span,
.mini-metrics span {
  color: var(--muted);
  background: var(--surface-soft);
}

.rate-row b {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.history-card {
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  align-items: center;
}

.analytics-section {
  margin-top: 14px;
}

.analytics-product-card {
  align-content: start;
}

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

.analytics-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.analytics-row h4,
.analytics-row p {
  margin: 0;
}

.analytics-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.analytics-row strong {
  font-size: 18px;
  white-space: nowrap;
}

.issue-summary {
  margin-bottom: 14px;
}

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

.issue-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-left-width: 5px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
}

.issue-card h4 {
  margin: 6px 0 4px;
  font-size: 16px;
}

.issue-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.issue-kicker,
.issue-actions,
.export-grid,
.db-safety-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.issue-kicker {
  font-size: 12px;
  color: var(--muted);
}

.severity-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.severity-critical {
  border-color: rgba(220, 38, 38, 0.55);
  background: rgba(254, 242, 242, 0.9);
  color: #991b1b;
}

.severity-high {
  border-color: rgba(217, 119, 6, 0.55);
  background: rgba(255, 251, 235, 0.9);
  color: #92400e;
}

.severity-medium {
  border-color: rgba(37, 99, 235, 0.42);
  background: rgba(239, 246, 255, 0.9);
  color: #1d4ed8;
}

.severity-low {
  border-color: rgba(100, 116, 139, 0.32);
  background: rgba(248, 250, 252, 0.9);
  color: #475569;
}

.db-safety-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.db-safety-metric {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(248, 250, 252, 0.86);
}

.db-safety-metric span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.db-safety-metric b {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.export-grid {
  align-items: stretch;
}

.audit-toolbar {
  align-items: center;
}

.audit-toolbar input {
  min-width: 180px;
}

.audit-table td {
  max-width: 260px;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-panel {
  width: min(620px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  padding: 18px;
}

.payment-confirm-modal {
  display: grid;
  gap: 14px;
}

.mini-summary {
  display: grid;
  gap: 8px;
}

.mini-summary h5 {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.compact-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
}

.compact-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.payment-simple-filters {
  align-items: end;
}

.payment-summary-cards {
  margin-top: 14px;
}

.payment-summary-card {
  border: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
}

.payment-summary-card.active,
.payment-summary-card:focus-visible {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
  outline: none;
}

.payment-drilldown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.payment-day-card {
  display: grid;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.payment-day-card h5 {
  margin: 0;
  font-size: 15px;
}

.payment-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.payment-line > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.payment-line-formula {
  white-space: nowrap;
  text-align: right;
}

.payment-archive-card {
  grid-template-columns: 1fr;
}

.payment-archive-card summary {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 13px;
  align-items: center;
  cursor: pointer;
}

.payment-archive-summary,
.payment-archive-lines {
  margin-top: 12px;
}

.finance-admin-grid {
  align-items: start;
}

.finance-detail-panel {
  margin-top: 14px;
}

.finance-table td {
  vertical-align: top;
}

.request-section {
  display: grid;
  gap: 10px;
}

.request-section h3 {
  margin: 0;
  font-size: 16px;
}

.request-section .history-list {
  gap: 8px;
}

.request-card {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  box-shadow: none;
}

.request-card.is-editing {
  grid-template-columns: 1fr;
}

.request-card h4 {
  font-size: 15px;
  line-height: 1.15;
}

.request-card p {
  overflow: hidden;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-card > strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}

.request-card .badge {
  min-height: 26px;
  align-self: center;
  padding: 5px 9px;
  font-size: 12px;
}

.request-card .actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.request-card .btn {
  min-width: 0;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  font-size: 12px;
  white-space: nowrap;
}

.request-card .request-approve {
  color: #fff;
  border-color: var(--text);
  background: var(--text);
}

.request-card .request-reject {
  color: var(--danger);
  border-color: rgba(199, 55, 47, 0.18);
  background: rgba(255, 255, 255, 0.72);
}

.request-section .request-card {
  grid-template-columns: 1fr;
}

.request-section .request-card .actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: stretch;
}

.request-section .request-card.is-editing .actions {
  grid-template-columns: 1fr;
}

.request-section .request-card .btn {
  width: 100%;
  padding-right: 6px;
  padding-left: 6px;
}

.request-section .request-card p {
  white-space: normal;
}

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

.context-strip span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 720;
}

.compact-filter {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.compact-filter select {
  min-height: 40px;
}

.request-edit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.request-edit input,
.request-edit select {
  min-height: 38px;
}

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

.task-card {
  overflow: hidden;
}

.task-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.admin-task-card {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.admin-task-card .badge {
  white-space: nowrap;
}

.task-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(94px, auto));
  justify-content: end;
  gap: 8px;
}

.task-actions .btn {
  width: auto;
  min-width: 94px;
  min-height: 38px;
  padding: 8px 12px;
}

.assistant-page {
  display: grid;
  gap: 14px;
}

.assistant-chat {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: calc(var(--radius) + 6px);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-soft);
}

.assistant-thread {
  display: grid;
  align-content: start;
  min-height: 460px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 18px;
  background: transparent;
}

.assistant-chat.compact .assistant-thread {
  min-height: 260px;
  max-height: 320px;
}

.assistant-empty {
  display: grid;
  gap: 7px;
  align-self: center;
  justify-self: center;
  max-width: 360px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.assistant-empty b {
  color: var(--text);
}

.assistant-message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
}

.assistant-message.user {
  background: transparent;
}

.assistant-message.user .assistant-avatar {
  background: var(--accent);
}

.assistant-bubble {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.assistant-message.user .assistant-bubble {
  background: var(--surface-soft);
}

.assistant-role {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.assistant-bubble p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.48;
}

.assistant-bubble small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.assistant-message-files {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.assistant-message-files span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 760;
}

.assistant-observations {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.assistant-observations span {
  padding: 8px;
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.assistant-composer {
  margin: 0 14px 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.assistant-composer textarea {
  min-height: 64px;
  resize: vertical;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
}

.assistant-composer textarea:focus {
  box-shadow: none;
}

.assistant-composer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-composer-bar {
  margin-top: 10px;
}

.composer-spacer {
  flex: 1 1 auto;
}

.composer-icon,
.composer-send {
  position: relative;
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 520;
}

.composer-icon {
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-soft);
}

.assistant-composer-bar > .composer-icon:first-child {
  border-color: transparent;
  background: transparent;
  font-size: 25px;
  font-weight: 360;
}

.assistant-voice-button {
  font-size: 0;
}

.assistant-voice-button::before {
  content: "";
  width: 8px;
  height: 12px;
  border: 1.8px solid currentColor;
  border-radius: 999px;
  transform: translateY(-2px);
}

.assistant-voice-button::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 9px;
  border: 1.8px solid currentColor;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  transform: translateY(4px);
}

.assistant-voice-button span {
  display: none;
}

.assistant-voice-button[data-voice-state="recording"] {
  color: var(--danger);
}

.assistant-voice-button[data-voice-state="transcribing"] {
  color: var(--accent);
}

.assistant-voice-button[data-voice-state="recording"]::after {
  width: 12px;
  height: 14px;
  border: 0;
  border-right: 4px solid currentColor;
  border-left: 4px solid currentColor;
  border-radius: 0;
  transform: none;
}

.assistant-voice-button[data-voice-state="transcribing"]::after {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 999px;
  transform: none;
}

.assistant-voice-button[data-voice-state="recording"]::before,
.assistant-voice-button[data-voice-state="transcribing"]::before {
  display: none;
}

.assistant-secondary-action {
  justify-self: center;
  width: fit-content;
  margin-top: 2px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 760;
}

.composer-send {
  color: #fff;
  background: var(--text);
  font-size: 19px;
  line-height: 1;
}

.assistant-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-attachments span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 34px;
  padding: 5px 8px 5px 5px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.assistant-attachments img {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  object-fit: cover;
}

.assistant-attachments button {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
}

.field-tool-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.report-versions {
  margin-bottom: 14px;
}

.version-list {
  display: grid;
  gap: 8px;
}

.version-list details {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.68);
}

.version-list summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 760;
}

.version-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}

.version-grid div {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.version-grid p {
  margin: 0;
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.calc-row:last-child {
  border-bottom: 0;
}

.shift-report-comments,
.shift-system-review {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.shift-report-comments h4,
.shift-system-review h4,
.comment-section h5 {
  margin: 0;
}

.comment-section,
.comment-list {
  display: grid;
  gap: 8px;
}

.comment-section h5 {
  color: var(--accent);
  font-size: 13px;
}

.comment-card {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
}

.comment-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}

.comment-card span {
  color: var(--muted);
  font-size: 12px;
}

.comment-card p,
.shift-system-review p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.report-line {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(130px, 0.9fr) 90px 90px 100px minmax(140px, 1fr) 42px;
  gap: 8px;
  align-items: end;
  padding: 10px;
}

.report-builder {
  display: grid;
  gap: 10px;
}

.builder-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.line-kicker {
  grid-column: 1 / -1;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.builder-line {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

.builder-line .btn.danger {
  width: 42px;
  min-width: 42px;
  height: 38px;
  justify-self: end;
  padding: 0;
}

.line-total {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.line-total span,
.line-summary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.line-total b {
  font-size: 18px;
}

.line-summary {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(65, 105, 244, 0.06);
}

.shared-toggle {
  align-self: center;
}

.compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subpanel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
}

.access-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
}

.access-editor h4,
.access-editor p {
  margin: 0;
}

.access-editor p {
  color: var(--muted);
  font-size: 13px;
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.small-input {
  min-height: 36px;
}

.combo {
  position: relative;
  display: grid;
  gap: 6px;
}

.combo-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 230px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-soft);
}

.combo-menu.hidden {
  display: none;
  pointer-events: none;
}

.combo-option {
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 16px;
  font-weight: 720;
  cursor: pointer;
}

.combo-option span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
}

.combo-option:hover,
.combo-option:focus {
  background: rgba(65, 105, 244, 0.08);
}

.combo-add {
  color: var(--accent-dark);
}

.combo-empty {
  padding: 9px 10px;
  color: var(--muted);
  font-size: 14px;
}

.combo-sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
}

.combo-sheet.hidden {
  display: none;
}

.combo-sheet:not(:empty) {
  display: block;
}

.combo-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 22, 0.28);
}

.combo-sheet-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  max-height: min(78vh, 620px);
  gap: 10px;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-strong);
}

.combo-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.combo-sheet-search {
  width: 100%;
}

.combo-sheet-list {
  display: grid;
  max-height: 46vh;
  gap: 4px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.work-table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.work-table th,
.work-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.work-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.work-table tr:hover td {
  background: rgba(65, 105, 244, 0.035);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions .btn {
  min-height: 34px;
  padding: 7px 10px;
}

.inline-editor {
  margin-top: 12px;
}

.product-mobile-list,
.report-catalog-mobile-list {
  display: none;
}

.category-manager {
  margin-top: 14px;
}

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

.category-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(280px, 2fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: #fff;
}

.category-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.category-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.category-actions input,
.category-actions select {
  max-width: 220px;
}

.shared-participants {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(65, 105, 244, 0.04);
}

.shared-participants > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.shared-person {
  min-height: 34px;
}

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

.step-list div {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
}

.step-list b {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: var(--radius);
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.live-time {
  display: inline-flex;
  margin-top: 14px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.shift-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.calendar-day {
  display: grid;
  min-height: 58px;
  align-content: center;
  gap: 5px;
  padding: 8px 4px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  text-align: center;
}

.calendar-day.worked {
  color: var(--accent-dark);
  border-color: rgba(65, 105, 244, 0.22);
  background: var(--accent-soft);
}

.calendar-day span,
.calendar-day b {
  font-size: 11px;
  line-height: 1;
}

.panel-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.hours-chart {
  display: grid;
  gap: 10px;
}

.hours-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 54px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.hours-row div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.hours-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.hours-row b {
  color: var(--text);
  text-align: right;
}

.login-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 26px;
  align-items: center;
  padding: clamp(22px, 5vw, 56px);
  background:
    radial-gradient(circle at 82% 10%, rgba(255, 255, 255, 0.92) 0 120px, transparent 310px),
    linear-gradient(180deg, #f8f9fb 0%, #f3f5f8 42%, #eef1f5 100%);
}

.login-page::after {
  content: "";
  position: fixed;
  right: -110px;
  top: 80px;
  width: min(72vw, 420px);
  height: min(72vw, 420px);
  border-radius: 86px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(180, 190, 194, 0.32));
  box-shadow: inset -38px -42px 90px rgba(108, 118, 122, 0.18), 0 40px 120px rgba(90, 100, 102, 0.12);
  transform: rotate(20deg);
  pointer-events: none;
}

.login-page::before {
  content: "";
  position: fixed;
  left: -120px;
  bottom: -160px;
  width: min(76vw, 460px);
  height: min(76vw, 460px);
  border-radius: 96px;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.9) 0 12%, transparent 13%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(187, 199, 206, 0.24));
  box-shadow:
    inset 34px 34px 90px rgba(255, 255, 255, 0.72),
    inset -38px -42px 90px rgba(108, 118, 122, 0.12),
    0 40px 120px rgba(90, 100, 102, 0.1);
  transform: rotate(-14deg);
  pointer-events: none;
}

.login-hero {
  position: relative;
  z-index: 1;
}

.login-title {
  display: block;
}

.login-hero h1 {
  max-width: 780px;
  margin: 0;
  color: var(--text);
  font-size: clamp(48px, 8vw, 84px);
  line-height: 0.96;
  font-weight: 800;
}

.login-by {
  display: inline-flex;
  margin-left: 6px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  vertical-align: baseline;
}

.login-panel {
  position: relative;
  z-index: 1;
}

.login-box {
  padding: 24px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.demo-logins {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  display: block;
}

table {
  display: table;
}

.toast-stack {
  position: fixed;
  top: 82px;
  right: 22px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  font-weight: 750;
}

.toast.ok {
  border-color: rgba(47, 91, 224, 0.24);
}

.toast.warn {
  border-color: rgba(217, 145, 28, 0.34);
}

.toast.danger {
  border-color: rgba(190, 54, 45, 0.34);
}

@media (max-width: 920px) {
  .layout {
    display: block;
    padding-top: 60px;
    padding-left: 0;
  }

  .sidebar {
    position: sticky;
    height: auto;
    width: auto;
    top: 60px;
    right: auto;
    bottom: auto;
    left: auto;
    padding: 10px clamp(14px, 3vw, 22px);
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    overflow-x: auto;
  }

  .nav {
    display: flex;
    width: max-content;
    justify-items: start;
  }

  .nav button {
    width: auto;
    min-width: 112px;
    height: 42px;
    flex-direction: row;
    gap: 8px;
    padding: 0 12px;
  }

  .nav-label {
    position: static;
    display: inline;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 12px;
    text-align: left;
  }

  .admin-sidebar .nav button {
    width: 84px;
    min-width: 84px;
    padding: 0 6px;
  }

  .admin-sidebar .nav-label {
    font-size: 10px;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .assistant-grid,
  .focus-panel,
  .form-row,
  .login-page {
    grid-template-columns: 1fr;
  }

  .issue-card {
    grid-template-columns: 1fr;
  }

  .issue-actions .btn,
  .export-grid .btn {
    width: 100%;
  }

  .db-safety-grid {
    grid-template-columns: 1fr;
  }

  .review-card,
  .history-card {
    grid-template-columns: 1fr;
  }

  .payment-archive-card summary {
    grid-template-columns: 1fr;
  }

  .admin-task-card {
    grid-template-columns: 1fr;
  }

  .admin-task-card .badge {
    justify-self: start;
  }

  .task-actions {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .task-actions .btn {
    width: 100%;
  }

  .request-card p {
    white-space: normal;
  }

  .request-card {
    grid-template-columns: 1fr;
  }

  .request-card .actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }

  .request-card.is-editing .actions {
    grid-template-columns: 1fr;
  }

  .request-card .btn {
    width: 100%;
    padding-right: 6px;
    padding-left: 6px;
  }

  .login-hero h1 {
    font-size: clamp(46px, 11vw, 72px);
  }
}

@media (max-width: 640px) {
  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  .builder-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .report-line,
  .builder-line {
    grid-template-columns: 1fr;
  }

  .nav button,
  .nav-label,
  .badge,
  .status-pill,
  .mini-metrics span {
    font-size: 11px;
  }

  .shell::before,
  .login-page::after,
  .login-page::before {
    width: 190px;
    height: 190px;
    top: 92px;
    right: -90px;
    border-radius: 54px;
  }

  .topbar {
    min-height: 60px;
    padding: 12px 14px 12px 22px;
  }

  .layout {
    padding-top: 60px;
  }

  .brand-mark {
    width: 40px;
    height: 30px;
    flex-basis: 40px;
  }

  .brand h1 {
    font-size: 15px;
  }

  .brand p {
    display: none;
  }

  .topbar > .actions .btn {
    min-height: 34px;
    padding: 7px 10px;
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-soft);
    border-bottom: 0;
  }

  .nav {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .admin-sidebar .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-sidebar .nav button.mobile-extra {
    display: none;
  }

  .nav button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    flex-direction: column;
    gap: 4px;
    padding: 7px 4px;
    font-size: 11px;
  }

  .nav-label {
    display: block;
    width: 100%;
    font-size: 11px;
    text-align: center;
  }

  .nav-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  .content {
    padding: 20px 12px 146px;
  }

  .admin-menu-panel {
    top: 60px;
    bottom: calc(68px + env(safe-area-inset-bottom));
    left: 0;
    width: min(300px, 86vw);
    border-radius: 0 22px 22px 0;
  }

  .view-title {
    display: grid;
    gap: 12px;
  }

  .view-title h2 {
    font-size: 38px;
  }

  .focus-panel,
  .panel,
  .review-board {
    padding: 16px;
  }

  .focus-panel h3 {
    font-size: 31px;
  }

  .actions {
    display: grid;
  }

  .actions .btn,
  .btn {
    width: 100%;
  }

  .section-head,
  .analytics-row,
  .category-row {
    grid-template-columns: 1fr;
  }

  .product-table-wrap,
  .report-catalog-table-wrap {
    display: none;
  }

  .product-mobile-list,
  .report-catalog-mobile-list {
    display: grid;
  }

  .work-table {
    min-width: 760px;
  }

  .category-actions {
    justify-content: stretch;
  }

  .category-actions input,
  .category-actions select {
    max-width: none;
    width: 100%;
  }

  .analytics-row strong {
    white-space: normal;
  }

  .report-line {
    grid-template-columns: 1fr;
  }

  .payment-drilldown-head,
  .payment-line {
    display: grid;
    grid-template-columns: 1fr;
  }

  .payment-drilldown-head {
    align-items: stretch;
  }

  .payment-line-formula {
    white-space: normal;
    text-align: left;
  }

  .assistant-message {
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 14px;
  }

  .assistant-composer {
    margin: 0 10px 10px;
    border-radius: 22px;
  }

  .assistant-composer-bar {
    gap: 7px;
  }

  .assistant-composer .btn {
    width: auto;
    min-width: 0;
    padding-right: 12px;
    padding-left: 12px;
  }

  .version-grid {
    grid-template-columns: 1fr;
  }

  .avatar,
  .assistant-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .login-page {
    align-content: start;
    padding: 24px 14px;
  }

  .login-hero h1 {
    font-size: 48px;
  }

  .toast-stack {
    top: auto;
    right: 12px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
  }
}
