:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef4f2;
  --surface-strong: #fbfcfc;
  --text: #172026;
  --muted: #60717d;
  --line: #d8e1e5;
  --brand: #16645a;
  --brand-strong: #0d3f39;
  --accent: #c27a2c;
  --danger: #b42318;
  --ok: #13795b;
  --shadow: 0 18px 42px rgba(23, 32, 38, 0.08);

  /* Duracion por defecto de transition.css (vendorizado), mas agil que el 2.5s de la libreria. */
  --transition__duration: 0.4s;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.is-hidden {
  display: none !important;
}

.auth-screen {
  align-items: stretch;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 420px);
  min-height: 100vh;
  padding: 28px;
}

.auth-screen__hero,
.auth-card,
.kpi-card,
.panel,
.sidebar-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-screen__hero {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.86) 100%),
    linear-gradient(140deg, var(--surface-soft) 0%, #f7faf9 52%, #fff5eb 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px;
}

.auth-brand,
.brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand-mark,
.brand-logo {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 800;
}

.brand-logo {
  background: var(--surface);
  border: 1px solid var(--line);
  object-fit: cover;
  padding: 4px;
}

.auth-brand strong,
.brand strong,
.auth-brand span,
.brand span {
  display: block;
}

.auth-brand span,
.brand span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.auth-copy {
  max-width: 540px;
}

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

h1,
h2 {
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: 38px;
  line-height: 1.05;
  max-width: 12ch;
}

h2 {
  font-size: 18px;
  line-height: 1.3;
}

.auth-copy__text {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  margin: 14px 0 0;
  max-width: 52ch;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  justify-content: center;
  padding: 28px;
}

.auth-card__header,
.topbar,
.panel-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

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

.field input {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  outline: none;
  padding: 0 14px;
}

.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(22, 100, 90, 0.12);
}

.auth-form__actions {
  display: grid;
  gap: 10px;
}

.primary-button,
.secondary-button {
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
}

.primary-button {
  background: var(--brand);
  border: 0;
  color: #ffffff;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.8;
}

.secondary-button {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  width: 100%;
}

.form-message {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.form-message[data-state="error"] {
  color: var(--danger);
}

.auth-card__footer {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
  padding-top: 20px;
}

.auth-card__footer strong,
.auth-card__footer span {
  display: block;
}

.auth-card__footer strong {
  font-size: 13px;
}

.auth-card__footer span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 750;
  min-width: 138px;
  padding: 9px 12px;
  text-align: center;
}

.status-pill[data-state="ok"] {
  border-color: rgba(19, 121, 91, 0.24);
  background: rgba(19, 121, 91, 0.08);
  color: var(--ok);
}

.status-pill[data-state="error"] {
  border-color: rgba(180, 35, 24, 0.24);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.3s ease;
}

@media (min-width: 981px) {
  .app-shell[data-sidebar-collapsed="true"] {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}

.sidebar {
  background: var(--surface-strong);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: hidden;
  padding: 24px 18px;
  position: relative;
}

.sidebar-toggle {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  height: 26px;
  width: 26px;
  padding: 0;
  place-items: center;
  position: absolute;
  right: -13px;
  top: 26px;
  transition: color 0.2s ease;
  z-index: 2;
}

.sidebar-toggle:hover {
  color: var(--brand-strong);
}

.sidebar-toggle .icon {
  transition: transform 0.3s ease;
}

.app-shell[data-sidebar-collapsed="true"] .sidebar-toggle .icon {
  transform: rotate(180deg);
}

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

.nav-item {
  align-items: center;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-weight: 650;
  gap: 12px;
  padding: 11px 12px;
  white-space: nowrap;
}

.nav-item.is-active,
.nav-item:hover {
  background: var(--surface-soft);
  color: var(--brand-strong);
}

.nav-item__icon {
  flex-shrink: 0;
}

.nav-item__label {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.sidebar-panel {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 16px;
}

.sidebar-panel__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar-panel strong {
  font-size: 16px;
  white-space: nowrap;
}

.sidebar-panel span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.sidebar-panel .secondary-button {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.sidebar-avatar {
  align-items: center;
  background: var(--brand);
  border-radius: 50%;
  color: #ffffff;
  display: none;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  width: 36px;
}

/* Sidebar colapsado: solo iconos centrados, sin texto, con avatar como resumen de sesion. */
.app-shell[data-sidebar-collapsed="true"] .brand-text,
.app-shell[data-sidebar-collapsed="true"] .nav-item__label,
.app-shell[data-sidebar-collapsed="true"] .sidebar-panel__label,
.app-shell[data-sidebar-collapsed="true"] .sidebar-panel strong,
.app-shell[data-sidebar-collapsed="true"] .sidebar-panel > span,
.app-shell[data-sidebar-collapsed="true"] .sidebar-panel__logout-label {
  display: none;
}

.app-shell[data-sidebar-collapsed="true"] .sidebar-avatar {
  display: grid;
}

.app-shell[data-sidebar-collapsed="true"] .nav-item {
  justify-content: center;
  padding: 11px;
}

.app-shell[data-sidebar-collapsed="true"] .sidebar-panel {
  justify-items: center;
  padding: 16px 0;
}

.app-shell[data-sidebar-collapsed="true"] .sidebar-panel .secondary-button {
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 0;
  width: 36px;
}

.main-panel {
  min-width: 0;
  padding: 28px;
}

.topbar {
  margin-bottom: 24px;
}

.topbar__actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.user-chip {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  min-width: 176px;
  padding: 10px 12px;
}

.user-chip strong {
  font-size: 14px;
}

.user-chip span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.client-banner {
  margin-bottom: 18px;
  overflow: hidden;
}

.client-banner__content {
  align-items: center;
  background:
    linear-gradient(135deg, var(--surface-soft) 0%, rgba(255, 255, 255, 0.98) 68%);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 132px;
  padding: 20px 22px;
}

.client-banner__eyebrow {
  color: var(--brand-strong);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.client-banner__text strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.client-banner__text p {
  color: var(--muted);
  margin: 0;
}

.client-swatch {
  aspect-ratio: 1;
  background: var(--brand);
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  padding: 14px;
  place-content: end start;
}

.client-swatch span {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.9;
}

.client-swatch strong {
  font-size: 18px;
  line-height: 1.1;
  margin-top: 6px;
}

.kpi-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.kpi-card {
  min-height: 112px;
  padding: 18px;
}

.kpi-card span {
  color: var(--muted);
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
}

.kpi-card strong {
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Modo cliente: panel mas espacioso y personal. Modo admin: consola densa, sin cambios. */
#appShell[data-role="client"] .kpi-grid {
  gap: 20px;
}

#appShell[data-role="client"] .kpi-card {
  min-height: 132px;
  padding: 24px;
}

#appShell[data-role="client"] .kpi-card strong {
  font-size: 42px;
}

#appShell[data-role="client"] .client-banner__text strong {
  font-size: 28px;
}

.workspace {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.panel {
  overflow: hidden;
}

.panel-heading {
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.module-list {
  display: grid;
}

.module-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 58px;
  padding: 0 18px;
}

.module-row + .module-row {
  border-top: 1px solid var(--line);
}

.module-row span {
  color: var(--muted);
}

.pr-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 18px;
}

.pr-list li {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 62px minmax(0, 1fr);
}

.pr-list span {
  background: var(--surface-soft);
  border-radius: 8px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
  padding: 7px 8px;
  text-align: center;
}

.nav-item--soon {
  cursor: default;
  opacity: 0.6;
}

.nav-item__badge {
  background: var(--surface-soft);
  border-radius: 999px;
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 800;
  margin-left: 6px;
  padding: 3px 8px;
  text-transform: uppercase;
}

.view {
  display: grid;
  gap: 18px;
}

.view-toolbar .panel-heading {
  flex-wrap: wrap;
}

.toolbar-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.field--inline {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.field--inline span {
  white-space: nowrap;
}

.field--inline select {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 10px;
}

.entity-form {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 18px;
}

.entity-form .field select {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 0 12px;
}

.entity-form .auth-form__actions {
  align-items: center;
  flex-direction: row;
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.icon {
  flex-shrink: 0;
  vertical-align: middle;
}

.icon-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  height: 32px;
  padding: 0;
  place-items: center;
  transition:
    background 0.15s ease,
    color 0.15s ease;
  width: 32px;
}

.icon-button:hover {
  background: var(--surface-soft);
  color: var(--brand-strong);
}

.icon-button--danger:hover {
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.entity-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  padding: 18px;
}

.entity-grid > .empty-cell {
  grid-column: 1 / -1;
}

.entity-card--skeleton {
  border-left-color: var(--line);
}

.entity-grid--qr {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.entity-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.entity-card__header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.entity-card__title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.entity-card__title strong {
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-card__subtitle {
  color: var(--muted);
  font-size: 13px;
}

.entity-card__meta {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 4px;
}

.entity-card__meta-row {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.entity-card__footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 10px;
}

.entity-card__readonly {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: auto;
  padding-top: 10px;
}

.entity-card--qr {
  align-items: center;
  text-align: center;
}

.entity-card__thumb {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 96px;
  object-fit: contain;
  padding: 8px;
  width: 96px;
}

.panel-heading__controls {
  align-items: center;
  display: flex;
  gap: 14px;
}

.view-mode-toggle {
  background: var(--surface-soft);
  border-radius: 8px;
  display: flex;
  gap: 2px;
  padding: 2px;
}

.view-mode-toggle__button {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  height: 26px;
  padding: 0;
  place-items: center;
  width: 26px;
}

.view-mode-toggle__button.is-active {
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--brand-strong);
}

/* Modo lista: las mismas tarjetas, reflujadas en fila en vez de en columna. */
.entity-grid[data-mode="list"] {
  grid-template-columns: 1fr;
}

.entity-grid[data-mode="list"] .entity-card {
  align-items: center;
  flex-direction: row;
  gap: 18px;
  padding: 12px 16px;
}

.entity-grid[data-mode="list"] .entity-card--qr {
  text-align: left;
}

.entity-grid[data-mode="list"] .entity-card__thumb {
  flex-shrink: 0;
  height: 48px;
  padding: 4px;
  width: 48px;
}

.entity-grid[data-mode="list"] .entity-card__header {
  flex: 1;
  min-width: 0;
}

.entity-grid[data-mode="list"] .entity-card__meta {
  display: flex;
  flex-shrink: 0;
  gap: 20px;
}

.entity-grid[data-mode="list"] .entity-card__meta-row {
  display: grid;
  gap: 1px;
  justify-content: normal;
}

.entity-grid[data-mode="list"] .entity-card__meta-row span:first-child {
  font-size: 11px;
  text-transform: uppercase;
}

.entity-grid[data-mode="list"] .entity-card__footer,
.entity-grid[data-mode="list"] .entity-card__readonly {
  border-top: 0;
  flex-shrink: 0;
  margin-top: 0;
  padding-top: 0;
}

.activity-feed {
  display: grid;
  gap: 2px;
  padding: 10px 18px;
}

.activity-entry {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  padding: 14px 0;
}

.activity-entry:last-child {
  border-bottom: 0;
}

.activity-entry__icon {
  align-items: center;
  background: var(--surface-soft);
  border-radius: 50%;
  color: var(--brand-strong);
  display: grid;
  flex-shrink: 0;
  height: 34px;
  place-items: center;
  width: 34px;
}

.activity-entry__body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.activity-entry__headline {
  font-size: 14px;
  font-weight: 650;
}

.activity-entry__meta {
  color: var(--muted);
  font-size: 12.5px;
}

.activity-entry__detail {
  color: var(--muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.pagination-controls {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 14px 18px;
}

.pagination-controls span {
  color: var(--muted);
  font-size: 13px;
  margin-right: auto;
}

.pagination-controls button {
  min-width: 96px;
}

.pagination-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.status-badge {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
}

.status-badge[data-status="active"] {
  background: rgba(19, 121, 91, 0.1);
  color: var(--ok);
}

.status-badge[data-status="inactive"],
.status-badge[data-status="paused"] {
  background: rgba(194, 122, 44, 0.12);
  color: var(--accent);
}

.status-badge[data-status="archived"] {
  background: rgba(96, 113, 125, 0.14);
  color: var(--muted);
}

.status-badge[data-status="draft"] {
  background: rgba(23, 32, 38, 0.08);
  color: var(--text);
}

.color-chip {
  border: 1px solid var(--line);
  border-radius: 4px;
  display: inline-block;
  height: 16px;
  margin-right: 8px;
  vertical-align: middle;
  width: 16px;
}

.field-group {
  display: grid;
  gap: 16px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qr-detail {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  padding: 18px;
}

.qr-detail__preview {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.qr-detail__preview img {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  height: auto;
  max-width: 100%;
  padding: 16px;
  width: 280px;
}

.qr-detail__downloads {
  display: grid;
  gap: 8px;
  width: 100%;
}

.qr-detail .module-list {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.charts-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 18px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.chart-card--wide {
  grid-column: 1 / -1;
}

.chart-card h3 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 14px;
  text-transform: uppercase;
}

.timeline-chart {
  align-items: flex-end;
  display: flex;
  gap: 6px;
  height: 160px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.timeline-bar-wrapper {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
  min-width: 22px;
}

.timeline-bar {
  background: var(--brand);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  width: 16px;
}

.timeline-bar-wrapper span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.bar-list {
  display: grid;
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
}

.bar-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 96px minmax(0, 1fr) 40px;
}

.bar-row__label {
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row__track {
  background: var(--surface-soft);
  border-radius: 999px;
  display: block;
  height: 8px;
  overflow: hidden;
}

.bar-row__fill {
  background: var(--brand);
  border-radius: 999px;
  display: block;
  height: 100%;
}

.bar-row__value {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

/* Login: transicion de bienvenida mas pausada que el resto de micro-interacciones. */
#appShell[transition-style] {
  --transition__duration: 0.9s;
}

.toast-container {
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  position: fixed;
  right: 24px;
  z-index: 100;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ok);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  max-width: 320px;
  padding: 12px 16px;
  pointer-events: auto;
}

.toast--error {
  border-left-color: var(--danger);
}

.empty-cell {
  color: var(--muted);
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 32px 18px;
  text-align: center;
}

.empty-cell p {
  margin: 0;
}

.skeleton-row td {
  padding: 10px 18px;
}

.skeleton-bar {
  background: linear-gradient(90deg, var(--surface-soft) 25%, var(--line) 37%, var(--surface-soft) 63%);
  background-size: 400% 100%;
  border-radius: 6px;
  height: 16px;
  width: 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-bar {
    animation: none;
  }
}

@media (max-width: 980px) {
  .auth-screen,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .sidebar-toggle {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    overflow-x: auto;
  }

  .kpi-grid,
  .workspace {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .auth-screen,
  .main-panel,
  .sidebar {
    padding: 18px;
  }

  .auth-card__footer,
  .kpi-grid,
  .workspace,
  .client-banner__content,
  .entity-form,
  .field-group,
  .qr-detail,
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-actions {
    flex-direction: column;
    width: 100%;
  }

  .topbar,
  .topbar__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .status-pill,
  .user-chip {
    width: 100%;
  }

  .module-row {
    grid-template-columns: 1fr;
    padding: 14px 18px;
  }

  .entity-grid[data-mode="list"] .entity-card {
    align-items: stretch;
    flex-direction: column;
  }

  .entity-grid[data-mode="list"] .entity-card__meta {
    flex-wrap: wrap;
  }
}
