.nav-group-label {
  padding: 10px 14px 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.desktop-only {
  display: none;
}

.sidebar-header {
  padding: 6px 14px 10px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 6px;
}

.sidebar-tenant-full {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 8px 4px;
}

.nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--divider);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-text {
  white-space: nowrap;
}

.mobile-tabbar .nav-link {
  flex-direction: column;
  gap: 3px;
  padding: 4px 2px;
  border-radius: 8px;
}

.mobile-tabbar .nav-icon {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 15px;
  line-height: 1;
}

.mobile-tabbar .nav-text {
  font-size: 10px;
  line-height: 1.1;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-link:hover .nav-icon {
  color: var(--primary);
  border-color: var(--primary-light);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-link.active .nav-icon {
  color: var(--primary);
  border-color: var(--primary);
}

.sidebar .nav-link {
  justify-content: flex-start;
  border-radius: 0;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
}

.sidebar .nav-link.active {
  border-right: 3px solid var(--primary);
}

.panel {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
}

.panel > * {
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.page-title-mobile {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.page-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.grid {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.grid.cols-2 {
  grid-template-columns: 1fr;
}

.grid.cols-3 {
  grid-template-columns: 1fr;
}

.grid.cols-4 {
  grid-template-columns: 1fr 1fr;
}

.sec-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}

.card-head {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--divider);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted);
}

.card-body {
  padding: var(--space-4);
  min-width: 0;
  overflow-x: hidden;
}

.kpi {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-color, var(--primary));
}

.kpi .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.kpi .value {
  margin-top: 6px;
  font-size: 24px;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--kpi-color, var(--text));
  line-height: 1;
}

.kpi .meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.prog {
  height: 4px;
  background: var(--divider);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 7px;
}

.prog-fill {
  height: 100%;
  border-radius: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.chip.error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error);
}

.chip.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}

.chip.success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.chip.primary {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: var(--primary);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 0;
}

.table th,
.table td {
  border-bottom: 1px solid var(--divider);
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  white-space: nowrap;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: #f8fbff;
}

.dashboard-table-body {
  padding: 0;
}

.dashboard-table-body .table th,
.dashboard-table-body .table td {
  padding-left: 14px;
  padding-right: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-2) var(--space-3);
  min-height: 34px;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font);
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease,
    transform 0.04s ease;
}

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

.btn.outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn.ghost {
  background: var(--surface-soft);
  border-color: var(--divider);
  color: var(--muted);
}

.btn.danger {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error);
}

.btn.success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.btn.full {
  width: 100%;
}

.btn.btn-sm {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 11px;
}

.btn:hover:not(:disabled):not([aria-disabled="true"]):not(.is-busy) {
  box-shadow: var(--shadow-sm);
}

.btn.primary:hover:not(:disabled):not([aria-disabled="true"]):not(.is-busy) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn.outline:hover:not(:disabled):not([aria-disabled="true"]):not(.is-busy) {
  background: var(--primary-light);
}

.btn.ghost:hover:not(:disabled):not([aria-disabled="true"]):not(.is-busy) {
  background: #eaf1f8;
  border-color: var(--border);
  color: var(--text);
}

.btn.danger:hover:not(:disabled):not([aria-disabled="true"]):not(.is-busy) {
  background: #fbd5d5;
}

.btn.success:hover:not(:disabled):not([aria-disabled="true"]):not(.is-busy) {
  background: #c8f4d4;
}

.btn:active:not(:disabled):not([aria-disabled="true"]):not(.is-busy) {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"],
.btn.is-busy {
  opacity: 0.62;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.form-row {
  display: grid;
  gap: var(--space-3);
}

.form-group label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
  font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  min-width: 0;
}

.form-control {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  min-width: 0;
}

.form-group input[type="file"] {
  max-width: 100%;
}

.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 6px;
}

.form-errors {
  margin-top: var(--space-1);
  color: var(--error);
  font-size: 11px;
  font-weight: 500;
}

.alert {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: var(--space-3);
  font-size: 12px;
}

.alert.success {
  border-color: var(--success-border);
  background: var(--success-bg);
}

.alert.error {
  border-color: var(--error-border);
  background: var(--error-bg);
}

.list {
  display: grid;
}

.list-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
  align-items: center;
}

.list-item:last-child {
  border-bottom: 0;
}

.recipe-row-link {
  text-decoration: none;
  color: inherit;
}

.recipe-row-link.selected {
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  padding-left: 7px;
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.li-arrow {
  color: var(--muted);
  font-size: 13px;
}

.item-title {
  font-size: 13px;
  font-weight: 700;
}

.item-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.li-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  border: 1px solid var(--divider);
  color: var(--muted);
  background: var(--surface-soft);
}

.li-icon.li-error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error);
}

.li-icon.li-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}

.li-icon.li-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.steps {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  min-width: 0;
  overflow-x: auto;
  margin-bottom: var(--space-3);
  margin-top: var(--space-3);
  scroll-behavior: smooth;
}

.import-preview-banner {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.import-count-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.import-count-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 10px 8px;
  text-align: center;
}

.count-val {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.count-lbl {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.text-success {
  color: var(--success);
}

.text-error {
  color: var(--error);
}

.text-warning {
  color: var(--warning);
}

.text-info {
  color: var(--info);
}

.issue-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: start;
  border-bottom: 1px solid var(--divider);
  padding: 9px 0;
}

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

.issue-line {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.issue-text {
  font-size: 12px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 70px;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--divider);
}

.step-line.done {
  background: var(--primary);
}

.step-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.step-circle.done {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.step-circle.active {
  border-color: var(--primary);
  color: var(--primary);
}

.step-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}

.step-label.active {
  color: var(--primary);
}

.kpi-stack {
  display: grid;
  gap: 10px;
}

.desktop-split {
  display: grid;
  grid-template-columns: 1fr;
  min-width: 0;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tab {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.qa-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.qa {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.qa > span {
  min-width: 0;
}

.qa-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--divider);
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 16px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qa-text {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.qa-sub {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 18px 12px;
  text-align: center;
}

.upload-icon {
  font-size: 24px;
  color: var(--primary);
}

.upload-title {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.upload-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--divider);
}

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

.toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.toggle-sub {
  margin-top: 1px;
  font-size: 11px;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


.topbar-avatar-btn {
  border: 0;
  cursor: pointer;
}

.profile-menu-panel {
  position: absolute;
  top: 48px;
  right: 12px;
  width: min(320px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 260;
  overflow: hidden;
}

.profile-menu-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface-soft);
}

.profile-menu-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.profile-menu-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.profile-menu-section {
  border-top: 1px solid var(--divider);
}

.profile-menu-section-label {
  padding: 8px 14px 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-menu-link {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 14px;
}

.profile-menu-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.profile-menu-link-button {
  cursor: pointer;
}

.profile-menu-link-button.is-active {
  color: var(--primary);
  background: var(--primary-light);
}

.profile-menu-link-danger {
  color: var(--error);
}

.profile-menu-link-danger:hover {
  background: var(--error-bg);
  color: var(--error);
}

.profile-tenant-switch-form,
.profile-menu-logout-form {
  margin: 0;
}

.session-warning-bar {
  background: var(--warning);
  color: #fff;
  padding: 8px var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.session-warning-bar[hidden] {
  display: none !important;
}

.session-warning-title {
  font-size: 11px;
  font-weight: 700;
}

.session-warning-sub {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.session-warning-bar .btn {
  border: 0;
  background: #fff;
  color: var(--warning);
  white-space: nowrap;
}

.session-lock-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 400;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.session-lock-overlay[hidden] {
  display: none !important;
}

.session-lock-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.session-lock-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.session-lock-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.session-reauth-form {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.session-reauth-form label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.session-reauth-error {
  color: var(--error);
  font-size: 11px;
  font-weight: 600;
}


.switch {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

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

.switch-slider {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  transition: background-color 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.switch-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.switch .toggle-input:checked + .switch-slider {
  background: var(--primary-light);
  border-color: var(--primary);
}

.switch .toggle-input:checked + .switch-slider::after {
  transform: translateX(18px);
  background: var(--primary);
}

.switch .toggle-input:focus-visible + .switch-slider {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
