body.app-body {
  background:
    radial-gradient(circle at top left, rgba(87, 199, 255, 0.08), transparent 18%),
    linear-gradient(180deg, #eff5fb 0%, #f8fbff 100%);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 288px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px 14px;
  background: linear-gradient(180deg, #0d1828 0%, #12243c 100%);
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.sidebar .brand {
  color: var(--white);
}

.sidebar-brand {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 10px 8px 6px;
  text-align: center;
}

.sidebar-brand img {
  width: 96px;
  height: 96px;
  border-radius: 30px;
  box-shadow: 0 22px 40px rgba(8, 15, 28, 0.34);
}

.sidebar-brand .brand-copy {
  align-items: center;
  gap: 8px;
}

.sidebar-brand .brand-copy span {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #ffffff;
  text-decoration: none;
}

.sidebar-brand .brand-copy small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(87, 199, 255, 0.12);
  border: 1px solid rgba(87, 199, 255, 0.18);
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
  padding: 4px 8px 4px 6px;
  margin-right: -4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(87, 199, 255, 0.38) rgba(255, 255, 255, 0.06);
}

.sidebar-scroll::-webkit-scrollbar {
  width: 10px;
}

.sidebar-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(87, 199, 255, 0.4), rgba(31, 111, 235, 0.52));
  border-radius: 999px;
  border: 2px solid rgba(13, 24, 40, 0.3);
}

.workspace-switcher,
.sidebar-card {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.workspace-switcher strong,
.sidebar-card strong {
  display: block;
  margin-bottom: 8px;
}

.workspace-switcher small {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.7);
}

.workspace-switcher span {
  display: block;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 700;
  line-height: 1.35;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
  background: rgba(87, 199, 255, 0.12);
  color: var(--white);
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  padding: 0 6px 6px;
}

.app-main {
  padding: 22px;
}

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

.topbar-actions,
.filter-row,
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.search-box,
.ghost-input,
.ghost-select {
  min-height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.9);
  padding: 0 14px;
}

.dashboard-grid,
.content-grid,
.detail-grid,
.two-col,
.three-col,
.four-col,
.kanban-grid {
  display: grid;
  gap: 16px;
}

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

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: span 12;
}

.panel {
  padding: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: var(--border-soft);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-header h2,
.panel-header h3,
.page-hero h1 {
  margin: 0;
}

.panel-header p,
.page-hero p,
.table-wrap td,
.table-wrap th,
.timeline-item p,
.mini-list p,
.form-grid p,
.kanban-card p {
  color: var(--slate-500);
}

.kpi-card strong {
  display: block;
  font-size: 30px;
  letter-spacing: -0.04em;
  margin: 10px 0 8px;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(25, 195, 125, 0.12);
  color: #0f8f5a;
  font-size: 13px;
  font-weight: 700;
}

.chart-bars {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 12px;
  align-items: center;
}

.chart-track {
  height: 12px;
  border-radius: 999px;
  background: var(--surface-200);
  overflow: hidden;
}

.chart-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-700), var(--brand-500));
}

.chart-bar.success {
  background: linear-gradient(90deg, #0fb778, #50d7a4);
}

.table-wrap {
  overflow: auto;
}

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

.table-wrap th,
.table-wrap td {
  padding: 14px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.status-badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
}

.status-badge.open {
  background: rgba(31, 111, 235, 0.1);
  color: var(--brand-700);
}

.status-badge.success {
  background: rgba(25, 195, 125, 0.12);
  color: #0f8f5a;
}

.status-badge.warning {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.status-badge.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
}

.timeline-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: rgba(31, 111, 235, 0.1);
  display: grid;
  place-items: center;
  color: var(--brand-700);
  font-weight: 800;
}

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

.mini-list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

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

.kanban-column {
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: var(--border-soft);
  border-radius: 24px;
}

.kanban-stack {
  display: grid;
  gap: 12px;
}

.kanban-card {
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-100);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

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

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

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

.metric-box {
  padding: 18px;
  border-radius: 20px;
  background: var(--surface-100);
}

.metric-box strong {
  display: block;
  font-size: 26px;
  margin-top: 10px;
}

.settings-grid {
  display: grid;
  gap: 16px;
}

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

.form-grid .field-full {
  grid-column: span 2;
}

.form-grid label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: var(--graphite-700);
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  min-height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: var(--white);
  padding: 0 14px;
}

.form-grid textarea {
  min-height: 110px;
  padding: 12px 14px;
}

.page-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.automation-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  margin-bottom: 16px;
  background:
    radial-gradient(circle at top right, rgba(87, 199, 255, 0.18), transparent 28%),
    linear-gradient(135deg, #0f1f35, #123c66 58%, #0f172a);
  color: var(--white);
  overflow: hidden;
}

.automation-hero-clean {
  grid-template-columns: 1fr 320px;
  align-items: center;
}

.automation-hero-copy p,
.automation-hero-copy .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.automation-hero h1 {
  margin: 12px 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.04;
}

.automation-hero-aside {
  display: grid;
  gap: 14px;
}

.automation-overview {
  margin-bottom: 16px;
}

.automation-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 360px;
  gap: 16px;
  margin-bottom: 16px;
}

.automation-bottom {
  align-items: start;
}

.automation-setup-panel,
.automation-side-stack {
  display: grid;
  gap: 16px;
}

.provider-chooser {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.provider-choice {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #f8fbff;
  text-align: left;
  display: grid;
  gap: 10px;
  cursor: pointer;
}

.provider-choice.active {
  border-color: rgba(31, 111, 235, 0.28);
  background: linear-gradient(180deg, rgba(31, 111, 235, 0.08), rgba(255, 255, 255, 0.96));
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.provider-choice-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.provider-choice small {
  color: var(--slate-500);
  line-height: 1.5;
}

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

.compact-form {
  gap: 12px;
}

.automation-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.inline-feedback {
  min-height: 46px;
  display: flex;
  align-items: center;
  border-radius: 16px;
  padding: 0 14px;
  font-weight: 600;
}

.inline-feedback.success {
  background: rgba(25, 195, 125, 0.12);
  color: #0f8f5a;
}

.inline-feedback.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.inline-feedback.info {
  background: rgba(31, 111, 235, 0.1);
  color: var(--brand-700);
}

.qr-panel,
.endpoint-card,
.status-card {
  padding: 20px;
}

.qr-frame {
  display: grid;
  place-items: center;
  padding: 16px 0;
}

.qr-placeholder {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(18, 60, 102, 0.08), rgba(87, 199, 255, 0.06)),
    #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: grid;
  place-items: center;
}

.qr-corners::before,
.qr-corners::after,
.qr-placeholder::before,
.qr-placeholder::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border: 5px solid #1f6feb;
  border-radius: 10px;
}

.qr-corners::before {
  top: 18px;
  left: 18px;
  border-right: 0;
  border-bottom: 0;
}

.qr-corners::after {
  top: 18px;
  right: 18px;
  border-left: 0;
  border-bottom: 0;
}

.qr-placeholder::before {
  bottom: 18px;
  left: 18px;
  border-right: 0;
  border-top: 0;
}

.qr-placeholder::after {
  bottom: 18px;
  right: 18px;
  border-left: 0;
  border-top: 0;
}

.qr-dots {
  width: 132px;
  height: 132px;
  border-radius: 18px;
  background:
    radial-gradient(circle, #0f172a 18%, transparent 19%) 0 0 / 22px 22px,
    radial-gradient(circle, #0f172a 18%, transparent 19%) 11px 11px / 22px 22px,
    #ffffff;
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.8);
}

.qr-help strong {
  display: block;
  margin-bottom: 8px;
}

.endpoint-card strong {
  display: block;
  margin: 8px 0;
  font-size: 0.95rem;
  line-height: 1.55;
  word-break: break-word;
}

.compact-status .status-tile strong {
  font-size: 1.2rem;
}

.automation-notes {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.automation-notes strong {
  display: block;
  margin-bottom: 6px;
}

.automation-signal-card,
.automation-pulse {
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.automation-signal-card strong,
.automation-pulse strong,
.provider-card h3,
.qr-meta strong,
.endpoint-box strong,
.status-tile strong {
  display: block;
}

.automation-signal-card strong {
  font-size: 1.4rem;
  margin: 10px 0;
}

.automation-signal-card p,
.automation-pulse small {
  color: rgba(255, 255, 255, 0.72);
}

.automation-pulse {
  display: grid;
  gap: 10px;
  align-content: center;
}

.automation-pulse span {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #57c7ff;
  box-shadow: 0 0 0 8px rgba(87, 199, 255, 0.15);
}

.provider-showcase {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.provider-card {
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: var(--shadow-soft);
  background: rgba(255, 255, 255, 0.92);
}

.provider-card.official {
  background: linear-gradient(180deg, rgba(18, 60, 102, 0.98), rgba(15, 23, 42, 1));
  color: var(--white);
}

.provider-card.hybrid {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(232, 244, 255, 0.98));
}

.provider-card.alternate {
  background: linear-gradient(180deg, rgba(249, 250, 251, 0.98), rgba(241, 245, 249, 1));
}

.provider-card.official p,
.provider-card.official small,
.provider-card.official .provider-meta {
  color: rgba(255, 255, 255, 0.78);
}

.provider-card-top,
.provider-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.provider-meta {
  margin-top: 18px;
  color: var(--slate-500);
}

.automation-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 16px;
  margin-bottom: 16px;
}

.premium-panel {
  border-radius: 28px;
}

.automation-connect-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}

.qr-card {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, #f8fbff, #eef5fb);
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: grid;
  gap: 16px;
}

.qr-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.qr-visual {
  aspect-ratio: 1;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(18, 60, 102, 0.08), rgba(87, 199, 255, 0.1)),
    #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: 18px;
}

.qr-grid {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background:
    linear-gradient(90deg, #0f172a 10%, transparent 10%, transparent 20%, #0f172a 20%, #0f172a 30%, transparent 30%, transparent 40%, #0f172a 40%, #0f172a 50%, transparent 50%, transparent 60%, #0f172a 60%, #0f172a 70%, transparent 70%, transparent 80%, #0f172a 80%, #0f172a 90%, transparent 90%),
    linear-gradient(#0f172a 10%, transparent 10%, transparent 20%, #0f172a 20%, #0f172a 30%, transparent 30%, transparent 40%, #0f172a 40%, #0f172a 50%, transparent 50%, transparent 60%, #0f172a 60%, #0f172a 70%, transparent 70%, transparent 80%, #0f172a 80%, #0f172a 90%, transparent 90%);
  background-size: 32px 32px;
  background-position: center;
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.65);
}

.qr-meta p,
.endpoint-box p {
  color: var(--slate-500);
  line-height: 1.6;
}

.connection-card {
  display: grid;
  gap: 16px;
}

.endpoint-box {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(18, 60, 102, 0.06), rgba(87, 199, 255, 0.08));
  border: 1px solid rgba(87, 199, 255, 0.2);
}

.endpoint-box strong {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 8px;
  word-break: break-word;
}

.status-stack {
  display: grid;
  gap: 14px;
}

.status-tile {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.status-tile.success {
  background: linear-gradient(180deg, rgba(25, 195, 125, 0.12), rgba(255, 255, 255, 0.92));
}

.status-tile.warning {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.92));
}

.status-tile.open {
  background: linear-gradient(180deg, rgba(31, 111, 235, 0.12), rgba(255, 255, 255, 0.92));
}

.status-tile strong {
  margin: 10px 0 6px;
  font-size: 1.4rem;
}

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

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .sidebar-scroll {
    overflow: visible;
  }
}

@media (max-width: 980px) {
  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }

  .kanban-grid,
  .two-col,
  .three-col,
  .four-col,
  .form-grid,
  .provider-showcase,
  .automation-layout,
  .automation-connect-grid,
  .automation-hero,
  .automation-workspace,
  .provider-chooser {
    grid-template-columns: 1fr;
  }

  .form-grid .field-full {
    grid-column: span 1;
  }
}
