.content-grid {
  display: grid;
  gap: 12px;
}

.content-grid.two {
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(20, 30, 60, .035);
  padding: 14px;
}

.panel + .panel,
.content-grid + .panel,
.panel + .content-grid {
  margin-top: 12px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  margin: -2px -2px 12px;
  padding: 0 2px 10px;
}

.panel-head h2 {
  margin: 0;
  color: #101828;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-head a {
  color: var(--blue-strong);
  font-weight: 850;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metrics-grid.small,
.metrics-grid.accounts-metrics {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.metrics-grid.crud-metrics {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
}

.metric {
  display: grid;
  gap: 6px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 5px 14px rgba(20, 30, 60, .035);
  padding: 12px;
}

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

.metric strong {
  color: #101828;
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: 0;
}

.metric-blue { border-left-color: var(--blue); }
.metric-green { border-left-color: var(--green); }
.metric-orange { border-left-color: var(--orange); }
.metric-red { border-left-color: var(--red); }
.metric-violet { border-left-color: var(--violet); }
.metric-gray { border-left-color: #64748b; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.quick-actions a {
  display: grid;
  gap: 5px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.quick-actions strong {
  color: #111827;
  font-size: 14px;
}

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

.legacy-home-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: 0 6px 18px rgba(20, 30, 60, .04);
  margin-bottom: 12px;
  padding: 14px;
}

.legacy-home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.legacy-home-profile {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.legacy-home-mark {
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border: 2px solid rgba(15, 23, 42, .08);
  border-radius: 50%;
  background: #0f1f33;
  color: #f4e558;
  font-weight: 900;
}

.legacy-home-profile strong,
.legacy-home-profile em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legacy-home-profile strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
}

.legacy-home-profile em {
  margin-top: 3px;
  color: #0f766e;
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
}

.legacy-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  border-radius: 999px;
  background: linear-gradient(90deg, #48b0ff, #1e90ff);
  color: #fff;
  padding: 8px 16px;
  font-weight: 850;
  box-shadow: 0 10px 22px rgba(30, 144, 255, .22);
}

.legacy-primary-action:hover {
  color: #fff;
  transform: translateY(-1px);
}

.legacy-primary-action .legacy-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.legacy-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px 10px;
}

.legacy-feature {
  display: flex;
  align-items: center;
  flex-direction: column;
  min-height: 106px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
}

.legacy-feature:hover {
  border-color: #dbe7f5;
  background: #fff;
  box-shadow: 0 8px 22px rgba(20, 30, 60, .07);
  transform: translateY(-1px);
}

.legacy-feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: #f3f6fa;
  box-shadow: 0 4px 10px rgba(20, 30, 60, .03);
  margin-bottom: 8px;
}

.legacy-feature-icon .legacy-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.legacy-feature-label {
  display: -webkit-box;
  min-height: 34px;
  overflow: hidden;
  color: #20283a;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bg-p1 { background: linear-gradient(180deg, #fff7ed, #fff1e0); }
.bg-p2 { background: linear-gradient(180deg, #ebf8ff, #e6f4ff); }
.bg-p3 { background: linear-gradient(180deg, #f3e8ff, #f6ecff); }
.bg-p4 { background: linear-gradient(180deg, #eef2ff, #f7fbff); }
.bg-p5 { background: linear-gradient(180deg, #e6fffa, #eafaf7); }
.bg-p6 { background: linear-gradient(180deg, #fff1f2, #fff5f7); }

.app-menu-modal[hidden] {
  display: none;
}

.app-menu-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.app-menu-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, .46);
}

.app-menu-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: end center;
  min-height: 100%;
  padding: 18px;
}

.app-menu-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
  padding: 14px;
}

.app-menu-head,
.app-menu-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-menu-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.app-menu-profile {
  min-width: 0;
}

.app-menu-profile strong,
.app-menu-profile em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-menu-profile strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
}

.app-menu-profile em {
  color: #64748b;
  font-style: normal;
  font-size: 12px;
  font-weight: 750;
}

.app-menu-close {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: #eef2f7;
  color: #344054;
  padding: 0 12px;
  font-weight: 850;
}

.app-menu-primary {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  border: 2px solid #0ea5e9;
  border-radius: 18px;
  background: linear-gradient(135deg, #e0f2fe 0%, #ccfbf1 100%);
  color: #075985;
  box-shadow: 0 14px 34px rgba(14, 165, 233, .2);
  margin-bottom: 16px;
  padding: 16px 18px;
}

.app-menu-primary:hover {
  color: #075985;
  transform: translateY(-1px);
}

.app-menu-primary .qr-icon {
  display: grid;
  place-items: center;
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .12);
}

.app-menu-primary .legacy-icon {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.app-menu-primary strong,
.app-menu-primary em {
  display: block;
}

.app-menu-primary strong {
  color: #07559b;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 900;
  text-transform: uppercase;
}

.app-menu-primary em {
  margin-top: 5px;
  color: #0f766e;
  font-style: normal;
  font-size: 13px;
  font-weight: 750;
}

.app-menu-quick-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 90px;
  margin: 4px 0 12px;
}

.app-menu-mini-action {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: rgba(248, 250, 252, .82);
  box-shadow: inset 0 0 0 1px rgba(203, 213, 225, .65);
}

.app-menu-mini-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .12);
}

.app-menu-mini-action .legacy-icon {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.app-menu-section-title {
  margin: 12px 0 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.app-menu-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px 6px;
  margin-bottom: 8px;
}

.app-menu-feature {
  display: flex;
  align-items: center;
  flex-direction: column;
  min-height: 108px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
}

.app-menu-feature:hover,
.app-menu-feature.active {
  border-color: #dbe7f5;
  background: #fff;
  box-shadow: 0 8px 22px rgba(20, 30, 60, .07);
}

.app-menu-feature span:last-child {
  display: -webkit-box;
  overflow: hidden;
  color: #20283a;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(160px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

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

.bar-row strong {
  display: block;
  color: #1f2937;
  font-size: 13px;
}

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

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f6;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.status-neutral {
  border-color: #d8dee8;
  background: #eef2f7;
  color: #475467;
}

.status-paid {
  border-color: #bcebd3;
  background: #e7f8ef;
  color: #027a48;
}

.status-waiting {
  border-color: #fed7aa;
  background: #fff4df;
  color: #b45309;
}

.status-cancelled {
  border-color: #fecdd3;
  background: #fff0f1;
  color: #be123c;
}

.flash {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px 12px;
  font-weight: 750;
}

.flash-success {
  border-color: #a7f3d0;
  background: #ecfdf3;
  color: #027a48;
}

.flash-error {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.toast-stack {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 120;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 10px;
  border: 1px solid #dbe4ef;
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 14px 38px rgba(15, 23, 42, .18);
  padding: 10px 10px 10px 12px;
  color: #101828;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  pointer-events: auto;
  animation: toast-in .16s ease-out;
}

.app-toast-success { border-left-color: var(--green); }
.app-toast-error { border-left-color: var(--red); }
.app-toast-warning { border-left-color: var(--orange); }

.app-toast button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: #eef2f7;
  color: #475467;
  line-height: 1;
  padding: 0;
}

.app-toast.leaving {
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity .14s ease, transform .14s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

body.modal-open {
  overflow: hidden;
}

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

.action-confirm {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 18px;
}

.action-confirm-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, .42);
}

.action-confirm-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  width: min(420px, 100%);
  border: 1px solid rgba(255, 255, 255, .64);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .26);
  padding: 16px;
}

.action-confirm-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 22px;
  font-weight: 950;
}

.action-confirm-copy strong {
  display: block;
  color: #101828;
  font-size: 17px;
  font-weight: 950;
}

.action-confirm-copy p {
  margin: 5px 0 0;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.action-confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.error-panel {
  border-color: #fecdd3;
  background: #fff8f8;
}

.empty-state {
  display: grid;
  gap: 7px;
  min-height: 98px;
  align-content: center;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 16px;
  color: #344054;
}

.empty-state::before {
  content: "";
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.empty-state strong {
  color: #111827;
  font-size: 15px;
}

.empty-state span {
  color: var(--muted);
}

.empty-state .primary,
.empty-state .ghost {
  width: fit-content;
  min-width: 128px;
}

.legacy-page-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 98px;
  margin: 0 0 14px;
  padding: 18px 22px;
  border: 1px solid rgba(255, 255, 255, .48);
  border-bottom: 3px solid #facc15;
  border-radius: 16px;
  background: linear-gradient(120deg, #13a36f 0%, #0ea5e9 58%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .14);
}

.legacy-page-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 14px;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}

.legacy-page-hero-icon .legacy-icon,
.legacy-page-hero-icon img,
.legacy-page-hero-icon svg {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.legacy-page-hero-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.legacy-page-hero-text span {
  color: rgba(255, 255, 255, .9);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.legacy-page-hero-text strong {
  color: #fff;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 950;
}

.legacy-page-hero-text em {
  color: rgba(255, 255, 255, .94);
  font-size: 14px;
  font-style: normal;
  font-weight: 750;
}

@media (max-width: 680px) {
  .toast-stack {
    top: auto;
    right: 10px;
    bottom: 76px;
    left: 10px;
    width: auto;
  }

  .app-toast {
    border-radius: 9px;
    font-size: 12px;
    padding: 9px 9px 9px 11px;
  }

  .action-confirm {
    align-items: end;
    padding: 12px;
  }

  .action-confirm-card {
    grid-template-columns: 38px 1fr;
    border-radius: 14px;
    padding: 14px;
  }

  .action-confirm-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 19px;
  }

  .action-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
