:root {
  --ink-900: #1e2a28;
  --ink-700: #3d5552;
  --ink-500: #6e8a86;
  --accent-600: #8cc8c2;
  --accent-700: #74b3ad;
  --shell-100: #f5f7f4;
  --shell-200: #e8efea;
  --line-200: #d6e3dc;
  --card-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

html,
body {
  height: 100%;
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink-900);
  background: radial-gradient(1200px 600px at 85% -10%, #fff2d1 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 10%, #dff4ff 0%, transparent 55%),
    var(--shell-100);
}

.app-scale {
  --app-scale: 1;
  transform: translateX(calc((1 - var(--app-scale)) * 50%)) scale(var(--app-scale));
  transform-origin: top left;
  width: 100%;
}

.navbar > .container,
.page-shell > .container {
  width: 100%;
  max-width: min(1680px, calc(100vw - 2.5rem)) !important;
}

h1,
h2,
h3,
.title,
.brand-text {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  letter-spacing: -0.02em;
}

a {
  color: var(--ink-900);
}

.navbar {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-200);
}

.navbar-item,
.navbar-link {
  color: var(--ink-900);
  font-weight: 500;
}

.navbar-item:hover,
.navbar-link:hover,
.navbar-item.is-active,
.navbar-link.is-active {
  color: var(--ink-900);
  background: rgba(245, 158, 11, 0.12);
}

.navbar-dropdown {
  border-radius: 12px;
  border: 1px solid var(--line-200);
  box-shadow: var(--card-shadow);
}

.navbar-dropdown .navbar-item {
  border-radius: 10px;
  margin: 0.2rem 0.35rem;
  font-size: 0.92rem;
}

.navbar-dropdown .navbar-item:hover {
  background: var(--shell-100);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-logo {
  width: 36px;
  height: 36px;
  display: block;
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--line-200);
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #101827;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f8d477;
}

.user-pill {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line-200);
  font-size: 0.9rem;
}

.page-shell {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--ink-500);
  margin-bottom: 1rem;
}

.button.is-primary {
  background: var(--accent-600);
  border: none;
  color: #111827;
  font-weight: 600;
}

.button.is-primary:hover {
  background: var(--accent-700);
  color: #111827;
}

.app-footer {
  padding: 1.5rem;
  background: transparent;
  border-top: 1px solid var(--line-200);
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .app-scale {
    --app-scale: 0.96;
  }

  .page-shell {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1280px) and (max-width: 1599px) {
  .app-scale {
    --app-scale: 1;
  }

  .navbar > .container,
  .page-shell > .container {
    max-width: min(1760px, calc(100vw - 3.5rem)) !important;
  }
}

@media (min-width: 1600px) {
  .app-scale {
    --app-scale: 1;
  }

  .navbar > .container,
  .page-shell > .container {
    max-width: min(1880px, calc(100vw - 4rem)) !important;
  }
}

@media (min-width: 1920px) {
  .app-scale {
    --app-scale: 1;
  }

  .navbar > .container,
  .page-shell > .container {
    max-width: min(2040px, calc(100vw - 4.5rem)) !important;
  }
}

.global-live-toasts {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 9990;
  width: min(360px, calc(100vw - 2.2rem));
  display: grid;
  gap: 0.7rem;
  pointer-events: none;
}

.live-toast {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line-200);
  border-left: 4px solid var(--accent-700);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
  padding: 0.75rem 0.85rem;
  animation: live-toast-in 0.2s ease-out;
}

.live-toast.is-system {
  border-left-color: #3b82f6;
}

.live-toast.is-leaving {
  animation: live-toast-out 0.2s ease-in forwards;
}

.live-toast-title {
  margin: 0 0 0.28rem;
  font-weight: 700;
  color: var(--ink-900);
  font-size: 0.92rem;
}

.live-toast-line {
  margin: 0;
  color: var(--ink-700);
  font-size: 0.86rem;
  line-height: 1.35;
}

.live-toast-line.is-muted {
  color: var(--ink-500);
}

.live-toast-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
}

.live-toast-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f766e;
}

[data-live-pending-count].is-live-updated,
[data-live-pending-backoffice].is-live-updated,
[data-live-pending-cloud].is-live-updated {
  animation: live-count-flash 0.45s ease-out;
}

[data-live-pending-count],
[data-live-pending-backoffice],
[data-live-pending-cloud] {
  font-variant-numeric: tabular-nums;
}

.is-live-pulse {
  animation: live-pulse 0.75s ease-out;
}

@keyframes live-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes live-toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(116, 179, 173, 0.45);
    transform: translateZ(0);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(116, 179, 173, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(116, 179, 173, 0);
  }
}

@keyframes live-count-flash {
  0% {
    color: var(--ink-900);
    text-shadow: none;
  }

  45% {
    color: #0f766e;
    text-shadow: 0 0 12px rgba(15, 118, 110, 0.2);
  }

  100% {
    color: var(--ink-900);
    text-shadow: none;
  }
}
