/* Workspace — Lax Invoice, même philo que la landing */

.ws-body {
  --ws-font: var(--font, "Manrope", system-ui, sans-serif);
  --ws-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ws-radius: 16px;
  --ws-radius-sm: 12px;
  --ws-glass: color-mix(in srgb, var(--surface) 88%, transparent);
  --ws-line: color-mix(in srgb, var(--text) 8%, transparent);
  --ws-hover: color-mix(in srgb, var(--text) 4.5%, transparent);
  --ws-active: color-mix(in srgb, var(--blue) 12%, transparent);
  --ws-shadow: 0 1px 0 color-mix(in srgb, var(--text) 4%, transparent);
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ws-font);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

html[data-theme="light"] .ws-body {
  --ws-line: color-mix(in srgb, var(--text) 12%, transparent);
  --ws-shadow:
    0 1px 2px rgba(15, 15, 20, 0.05),
    0 0 0 1px rgba(15, 15, 20, 0.06);
}

.ws-body .btn {
  width: auto;
  min-width: 0;
  height: 40px;
  padding: 0 1.15rem;
  white-space: nowrap;
  gap: 0.45rem;
  border-radius: 980px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: none;
  transition: transform 0.12s var(--ws-ease), opacity 0.15s var(--ws-ease), filter 0.15s var(--ws-ease);
}

.ws-body .btn:active:not(:disabled):not(.is-busy) {
  transform: scale(0.98);
}

.ws-body .btn .ws-ico {
  width: 15px;
  height: 15px;
}

.ws-ico {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  pointer-events: none;
}

.ws-body .btn.is-busy {
  pointer-events: none;
  opacity: 0.72;
}

.ws-body .btn.is-busy::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ws-spin 0.55s linear infinite;
}

@keyframes ws-spin {
  to { transform: rotate(360deg); }
}

.ws-body .btn:focus-visible,
.ws-nav-link:focus-visible,
.ws-search:focus-visible,
.ws-tile:focus-visible,
.ws-company-card:focus-visible,
a.ws-metric:focus-visible,
.ws-link:focus-visible,
.ws-nav-toggle:focus-visible,
.ws-sidebar-toggle:focus-visible,
.ws-nav-close:focus-visible,
.ws-tab:focus-visible,
.ws-choice:focus-within,
.ws-field input:focus-visible,
.ws-field textarea:focus-visible,
.ws-field select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--blue-ring);
}

.ws-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.ws-backdrop {
  display: none;
}

.ws-orbs {
  display: none;
}

.ws-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(1rem, env(safe-area-inset-top)) 0.7rem max(0.85rem, env(safe-area-inset-bottom)) max(0.7rem, env(safe-area-inset-left));
  background: var(--bg);
  border-right: 1px solid var(--ws-line);
  z-index: 20;
}

.ws-sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0.55rem 0.85rem;
  color: var(--text);
  text-decoration: none;
}

.ws-sidebar-brand img {
  border-radius: 50%;
}

.ws-sidebar-brand strong,
.ws-sidebar-brand em {
  display: block;
  font-style: normal;
}

.ws-sidebar-brand strong {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.ws-sidebar-brand em {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
}

.ws-nav-label {
  display: none;
}

.ws-nav {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  flex: 1;
}

.ws-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 36px;
  padding: 0.4rem 0.7rem;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.9rem;
  letter-spacing: -0.014em;
  transition: background 0.15s var(--ws-ease), color 0.15s var(--ws-ease);
}

.ws-nav-link .ws-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.78;
}

.ws-nav-link:hover {
  background: var(--ws-hover);
  color: var(--text);
}

.ws-nav-link:hover .ws-ico,
.ws-nav-link.is-active .ws-ico {
  opacity: 1;
}

.ws-nav-link.is-active {
  background: var(--ws-active);
  color: var(--blue-hint);
  font-weight: 650;
}

html[data-theme="dark"] .ws-nav-link.is-active {
  color: #c5dbf4;
}

.ws-nav-link.muted {
  font-size: 0.8rem;
  font-weight: 500;
  min-height: 34px;
  color: var(--muted-soft);
}

.ws-sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  padding-top: 0.7rem;
  margin-top: 0.4rem;
  border-top: 1px solid var(--ws-line);
}

.ws-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  width: 100%;
  min-height: 36px;
  padding: 0.4rem 0.7rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}
.ws-sidebar-toggle:hover {
  background: var(--ws-hover);
  color: var(--text);
}
.ws-sidebar-toggle .ws-ico {
  width: 16px;
  height: 16px;
}
.ws-sidebar-toggle-out {
  display: none;
}

html.ws-sidebar-collapsed .ws-shell {
  grid-template-columns: 72px minmax(0, 1fr);
}
html.ws-sidebar-collapsed .ws-sidebar {
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}
html.ws-sidebar-collapsed .ws-sidebar-brand a {
  justify-content: center;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}
html.ws-sidebar-collapsed .ws-sidebar-brand span,
html.ws-sidebar-collapsed .ws-nav-link span {
  display: none;
}
html.ws-sidebar-collapsed .ws-nav-link,
html.ws-sidebar-collapsed .ws-sidebar-toggle {
  justify-content: center;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}
html.ws-sidebar-collapsed .ws-sidebar-toggle-in {
  display: none;
}
html.ws-sidebar-collapsed .ws-sidebar-toggle-out {
  display: inline-flex;
}

.ws-co-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.ws-co-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 148px;
}

.ws-main {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow-x: clip;
}

.ws-top-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.ws-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 52px;
  padding: max(0.4rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right)) 0.4rem max(1.5rem, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 0;
  position: sticky;
  top: 0;
  z-index: 8;
  backdrop-filter: saturate(180%) blur(20px);
}

.ws-top-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.ws-scope {
  display: flex;
  align-items: center;
  margin-right: 0.2rem;
}

.ws-scope select {
  max-width: 11.5rem;
  height: 36px;
  padding: 0 1.6rem 0 0.7rem;
  border: 0;
  border-radius: 980px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236e6e73' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='m2.5 4.5 3.5 3.5 3.5-3.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  cursor: pointer;
}

.ws-scope-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: var(--muted);
}

.ws-scope-link:hover {
  background: var(--ws-hover);
  color: var(--text);
}

.ws-scope-link .ws-ico {
  width: 16px;
  height: 16px;
}

.ws-top-title {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-top-title { display: none; }

.ws-nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.ws-nav-toggle:hover {
  background: var(--ws-hover);
}

.ws-nav-toggle .ws-ico,
.ws-nav-toggle svg {
  width: 18px;
  height: 18px;
}

.ws-nav-close,
.ws-sidebar-mobile,
.ws-nav-extra,
.ws-tabbar {
  display: none;
}

.ws-content {
  position: relative;
  padding: 1.75rem max(1.75rem, env(safe-area-inset-right)) max(3.5rem, env(safe-area-inset-bottom)) max(1.75rem, env(safe-area-inset-left));
  max-width: 860px;
  width: 100%;
  margin-inline: auto;
  min-width: 0;
}

.ws-page,
.ws-hero,
.ws-hero-cta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 0.25rem 0 1.75rem;
  margin: 0;
}

.ws-page-copy,
.ws-hero > :not(.ws-hero-bar):not(.btn),
.ws-hero-cta > div {
  min-width: 0;
  flex: 1;
}

.ws-kicker,
.ws-crumb {
  margin: 0 0 0.28rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
}

.ws-display,
.ws-h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3.2vw, 2.15rem);
  letter-spacing: -0.055em;
  line-height: 1.12;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ws-lead {
  margin: 0.45rem 0 0;
  color: var(--muted);
  max-width: 28em;
  font-size: 1.05rem;
  line-height: 1.47;
  font-weight: 500;
}

.ws-hero-bar,
.ws-page-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.ws-page-actions .btn {
  flex: 0 1 auto;
}

.ws-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.ws-filters select,
.ws-filters input[type="date"] {
  min-height: 40px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--ws-line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 550;
  transition: border-color 0.15s var(--ws-ease), box-shadow 0.15s var(--ws-ease);
}

.ws-filters select:hover,
.ws-filters input[type="date"]:hover {
  border-color: color-mix(in srgb, var(--text) 22%, var(--ws-line));
}

.ws-filters select:focus,
.ws-filters input[type="date"]:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--blue) 55%, var(--border));
  box-shadow: 0 0 0 3px var(--blue-ring);
}

.ws-period-range {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ws-period-range.is-hidden {
  display: none;
}

.ws-period-sep {
  color: var(--muted);
  font-size: 0.85rem;
}

.ws-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.ws-pager-meta {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--muted);
}

.ws-pager-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ws-pager-btn,
.ws-pager-num {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.45rem;
  border-radius: 10px;
  border: 1px solid var(--ws-line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 650;
}

.ws-pager-btn .ws-ico {
  width: 16px;
  height: 16px;
}

.ws-pager-btn:hover,
.ws-pager-num:hover {
  border-color: color-mix(in srgb, var(--text) 22%, var(--ws-line));
}

.ws-pager-num.is-on {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.ws-pager-btn.is-off {
  opacity: 0.38;
  pointer-events: none;
}

.ws-pager-gap {
  min-width: 1.1rem;
  text-align: center;
  color: var(--muted);
  font-weight: 650;
}

.ws-hero-bar {
  width: 100%;
  margin-top: 1rem;
}

.ws-search-wrap {
  position: relative;
  flex: 1;
  min-width: min(100%, 220px);
}

.ws-search-lg {
  max-width: 420px;
}

.ws-search-wrap .ws-ico {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted-soft);
  pointer-events: none;
}

.ws-search {
  width: 100%;
  height: 40px;
  font: inherit;
  font-size: 0.9rem;
  padding: 0 0.9rem 0 2.35rem;
  border: 1px solid var(--ws-line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
  transition: border-color 0.15s var(--ws-ease), box-shadow 0.15s var(--ws-ease);
}

.ws-search:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--blue) 55%, var(--border));
}

.ws-search-hint {
  display: none;
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted-soft);
  border: 1px solid var(--ws-line);
  border-radius: 6px;
  padding: 0.08rem 0.35rem;
  pointer-events: none;
}

@media (min-width: 901px) {
  .ws-search-hint { display: inline-block; }
}

.ws-section {
  margin-top: 0.35rem;
}

.ws-kind-block + .ws-kind-block {
  margin-top: 1.75rem;
}

.ws-h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  letter-spacing: -0.01em;
  font-weight: 650;
  color: var(--muted);
}

.ws-h2 > .ws-ico {
  width: 15px;
  height: 15px;
  opacity: 0.72;
}

.ws-h2 .ws-kind-ico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.ws-h2 .ws-kind-ico .ws-ico {
  width: 12px;
  height: 12px;
}

.ws-count {
  margin-left: 0.15rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted-soft);
  font-weight: 600;
}

.ws-kind-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: var(--paper-soft);
  color: var(--blue-hint);
  flex-shrink: 0;
}

.ws-kind-ico .ws-ico {
  width: 18px;
  height: 18px;
}

.kind-shop { background: #eaf2fa; color: #1f4f86; }
.kind-hospital { background: #eef0fb; color: #3b458f; }
.kind-property { background: #eef6ea; color: #2f6a32; }
.kind-ledger { background: #f7f0e4; color: #7a5420; }
.kind-booking { background: #f3eef8; color: #5a3d78; }
.kind-apps { background: var(--paper-soft); color: #555; }

html[data-theme="dark"] .kind-shop { background: #1d3554; color: #b9d4f0; }
html[data-theme="dark"] .kind-hospital { background: #2a2f5a; color: #c5caf5; }
html[data-theme="dark"] .kind-property { background: #1e3a24; color: #c3e2bf; }
html[data-theme="dark"] .kind-ledger { background: #3d3018; color: #efd3a0; }
html[data-theme="dark"] .kind-booking { background: #3a2d48; color: #dcc8ef; }

.ws-bento,
.ws-grid.apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
}

.ws-grid.companies,
.ws-grid.people {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  max-width: 640px;
}

.ws-stagger > * {
  animation: ws-rise 0.45s var(--ws-ease) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}

.ws-tile,
.ws-card-link,
.ws-company-card,
.ws-app-card,
.ws-panel,
.ws-person,
.ws-plan,
.ws-metric {
  --px: 50%;
  --py: 30%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  min-height: 0;
  padding: 0.95rem 1rem;
  background: var(--surface);
  border: 1px solid var(--ws-line);
  border-radius: var(--ws-radius-sm);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--ws-shadow);
  transition: transform 0.2s var(--ws-ease), border-color 0.2s ease, background 0.2s ease;
}

.ws-tile {
  min-height: 148px;
}

.ws-tile::before,
.ws-company-card::before,
.ws-metric::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(280px circle at var(--px) var(--py), color-mix(in srgb, var(--blue) 10%, transparent), transparent 46%);
  opacity: 0;
  transition: opacity 0.25s var(--ws-ease);
  z-index: -1;
  pointer-events: none;
}

.ws-tile:hover,
.ws-company-card:hover,
a.ws-metric:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--text) 16%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, var(--bg-muted));
}

.ws-tile:hover::before,
.ws-company-card:hover::before,
a.ws-metric:hover::before {
  opacity: 1;
}

.ws-tile.is-featured {
  grid-column: span 1;
  min-height: 148px;
  padding: 0.95rem 1rem;
}

.ws-tile.is-hidden,
.ws-card-link.is-hidden {
  display: none;
}

.ws-tile-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.ws-tile-copy {
  margin-top: auto;
  min-width: 0;
  width: 100%;
}

.ws-tile strong,
.ws-company-card strong,
.ws-person strong,
.ws-app-card strong,
.ws-plan strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.028em;
  margin-bottom: 0.12rem;
}

.ws-tile span,
.ws-company-card .ws-muted {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ws-tile .ws-go,
.ws-company-card .ws-go {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ws-hover);
  color: var(--muted);
  opacity: 0.55;
  transition: opacity 0.15s var(--ws-ease), color 0.15s var(--ws-ease), background 0.15s var(--ws-ease);
}

.ws-tile:hover .ws-go,
.ws-company-card:hover .ws-go {
  opacity: 1;
  color: var(--text);
}

.ws-go .ws-ico {
  width: 14px;
  height: 14px;
}

.ws-company-card,
.ws-person {
  flex-direction: row;
  align-items: center;
  min-height: 72px;
  padding: 0.75rem 0.9rem;
}

.ws-company-card > div:nth-child(2),
.ws-person > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.ws-co-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

.ws-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0 0 1.35rem;
}

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

.ws-table th.is-num,
.ws-table td.is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

a.ws-metric,
.ws-metric {
  min-height: 0;
  justify-content: flex-start;
  gap: 0.45rem;
  padding: 1rem 1.05rem 1.05rem;
}

.ws-metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.ws-metric-value {
  font-size: 1.85rem;
  letter-spacing: -0.045em;
  font-weight: 750;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.ws-metric-value.is-text {
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.ws-quick {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--muted-soft);
  margin-left: auto;
  flex-shrink: 0;
}

.ws-dot.on {
  background: #34c759;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.16);
}

.ws-dot.wait {
  background: #ff9f0a;
  box-shadow: 0 0 0 3px rgba(255, 159, 10, 0.16);
}

.ws-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--ws-hover);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: capitalize;
}

.ws-pill.role-owner,
.ws-pill.role-admin {
  background: var(--blue-soft);
  color: var(--blue-hint);
}

.ws-link {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: var(--blue);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.84rem;
}

.ws-link .ws-ico {
  width: 13px;
  height: 13px;
}

.ws-body a:hover,
.ws-body a:focus,
.ws-link:hover {
  text-decoration: none;
}

.ws-body .text-link {
  border-bottom: 0;
}

.ws-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--surface);
  border: 0;
  border-radius: 28px;
  box-shadow: var(--ws-shadow);
}

.ws-empty-mark { display: none; }

.ws-empty-mark .ws-ico {
  width: 20px;
  height: 20px;
}

.ws-empty p {
  margin: 0.15rem 0;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.ws-empty .ws-muted {
  font-weight: 500;
  font-size: 0.88rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.ws-empty .btn {
  margin-top: 1rem;
}

.ws-muted {
  color: var(--muted);
}

.ws-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted-soft);
  font-weight: 500;
}

.ws-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.ws-alert,
.ws-ok {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  font-weight: 550;
}

.ws-alert .ws-ico,
.ws-ok .ws-ico {
  width: 16px;
  height: 16px;
  margin-top: 0.12rem;
}

.ws-alert.is-in,
.ws-ok.is-in {
  animation: ws-toast 0.35s var(--ws-ease) both;
}

.ws-alert.is-out,
.ws-ok.is-out {
  animation: ws-toast-out 0.3s var(--ws-ease) both;
}

.ws-alert {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.ws-ok {
  background: var(--blue-soft);
  border: 1px solid rgba(52, 117, 186, 0.22);
  color: var(--blue-hint);
}

.ws-form {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.15rem;
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--ws-line);
  border-radius: var(--ws-radius);
  box-shadow: var(--ws-shadow);
}

.ws-field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  font-weight: 600;
  font-size: 0.8rem;
}

.ws-field input,
.ws-field textarea,
.ws-field select {
  font: inherit;
  font-weight: 500;
  font-size: 0.92rem;
  max-width: 100%;
  min-width: 0;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--ws-line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}

[hidden] {
  display: none !important;
}

.ws-alert[hidden],
.ws-ok[hidden] {
  display: none !important;
}

.ws-alert-list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  font-weight: 500;
}

.ws-alert-list li + li {
  margin-top: 0.2rem;
}

.ws-field.is-invalid input,
.ws-field.is-invalid textarea,
.ws-field.is-invalid select {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent);
}

.ws-field-msg {
  min-height: 0;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 550;
  color: var(--danger);
}

.ws-field-msg:empty {
  display: none;
}

.line-grid.is-invalid input,
.line-block.is-invalid .line-cell input {
  border-color: var(--danger);
}

.inv-card.is-invalid {
  box-shadow: 0 0 0 1px var(--danger-border);
}

.ws-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.ws-form-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.15rem;
}

.ws-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.ws-choice {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--ws-line);
  border-radius: 12px;
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.15s var(--ws-ease), background 0.15s var(--ws-ease);
}

.ws-choice:hover {
  border-color: color-mix(in srgb, var(--text) 16%, transparent);
}

.ws-choice.is-on {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.ws-choice input {
  margin-top: 0.2rem;
  accent-color: var(--blue);
}

.ws-choice strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.1rem;
}

.ws-choice span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.35;
}

.ws-panel,
.ws-plan {
  flex-direction: column;
  align-items: flex-start;
  min-height: 0;
  max-width: 440px;
  gap: 1rem;
}

.ws-profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ws-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.ws-avatar.placeholder {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
}

.ws-plan-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  color: var(--muted);
  font-size: 0.88rem;
  gap: 1rem;
}

.ws-app-card {
  min-height: 0;
}

.ws-app-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
}

.ws-instance-title {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.ws-search-empty {
  margin-top: 0.75rem;
  font-size: 0.88rem;
}

.ws-profile strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.028em;
}

.ws-profile .ws-muted {
  margin: 0.15rem 0 0;
  font-size: 0.84rem;
}

.ws-instance-title .ws-muted,
.ws-app-card .ws-muted {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
}

.ws-body .nav {
  flex-shrink: 0;
}

.ws-body .btn-nav {
  height: 36px;
  padding: 0 0.85rem;
  font-size: 0.82rem;
}

.ws-body .theme-toggle {
  width: 36px;
  height: 36px;
}

@keyframes ws-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes ws-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

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

@keyframes ws-toast-out {
  to { opacity: 0; transform: translateY(-4px); }
}

.ws-table-wrap {
  min-width: 0;
}

@media (max-width: 900px) {
  .ws-shell { grid-template-columns: 1fr; }
  .ws-nav-toggle {
    display: none;
  }
  .ws-sidebar-toggle,
  .ws-sidebar-foot {
    display: none;
  }
  html.ws-sidebar-collapsed .ws-shell {
    grid-template-columns: 1fr;
  }
  html.ws-sidebar-collapsed .ws-sidebar-brand span,
  html.ws-sidebar-collapsed .ws-nav-link span {
    display: block;
  }
  html.ws-sidebar-collapsed .ws-sidebar-brand a,
  html.ws-sidebar-collapsed .ws-nav-link {
    justify-content: flex-start;
    padding: 0.4rem 0.7rem;
  }
  .ws-body.ws-nav-open { overflow: hidden; }
  .ws-content {
    padding: 1rem max(1.05rem, env(safe-area-inset-right)) calc(5.4rem + env(safe-area-inset-bottom)) max(1.05rem, env(safe-area-inset-left));
  }
  .ws-top {
    min-height: 52px;
    padding: max(0.5rem, env(safe-area-inset-top)) max(0.9rem, env(safe-area-inset-right)) 0.5rem max(0.9rem, env(safe-area-inset-left));
  }
  .ws-top-left {
    min-width: 0;
    flex: 1;
  }
  .ws-scope-top,
  .ws-scope-link {
    display: flex;
  }
  .ws-sidebar-brand {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem;
  }
  .ws-sidebar-brand a {
    flex: 1;
    min-width: 0;
    padding-bottom: 0.45rem;
  }
  .ws-nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    margin-top: 0.1rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
  }
  .ws-nav-close:hover {
    background: var(--ws-hover);
    color: var(--text);
  }
  .ws-sidebar-mobile {
    display: block;
    padding: 0 0.15rem 0.75rem;
  }
  .ws-sidebar-mobile .ws-scope {
    margin: 0;
    width: 100%;
  }
  .ws-sidebar-mobile .ws-scope select {
    width: 100%;
    max-width: none;
    height: 44px;
    font-size: 16px;
  }
  .ws-nav-primary {
    display: none;
  }
  .ws-nav-extra {
    display: flex;
  }
  .ws-tabbar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 16;
    padding: 0.15rem 0.2rem max(0.28rem, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    border-top: 1px solid var(--ws-line);
    backdrop-filter: blur(18px) saturate(1.2);
    transition: transform 0.22s var(--ws-ease);
  }
  .ws-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.12rem;
    min-height: 52px;
    padding: 0.28rem 0.1rem 0.22rem;
    border: 0;
    background: none;
    color: var(--muted);
    text-decoration: none;
    font: inherit;
    font-size: 0.62rem;
    font-weight: 650;
    letter-spacing: -0.012em;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .ws-tab .ws-ico {
    width: 22px;
    height: 22px;
    opacity: 0.82;
  }
  .ws-tab.is-on,
  .ws-nav-open .ws-tab[data-ws-nav] {
    color: var(--text);
  }
  .ws-tab.is-on .ws-ico,
  .ws-nav-open .ws-tab[data-ws-nav] .ws-ico {
    opacity: 1;
  }
  html[data-theme="dark"] .ws-tab.is-on,
  html[data-theme="dark"] .ws-nav-open .ws-tab[data-ws-nav] {
    color: #c5dbf4;
  }
  .ws-tab-create {
    justify-content: flex-end;
  }
  .ws-tab-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-top: -1.15rem;
    margin-bottom: 0.08rem;
    border-radius: 50%;
    background: var(--text);
    color: var(--bg);
    box-shadow: 0 8px 18px rgba(15, 15, 15, 0.22);
  }
  .ws-tab-fab .ws-ico {
    width: 20px;
    height: 20px;
    opacity: 1;
  }
  html[data-theme="dark"] .ws-tab-fab {
    background: #f4f4f5;
    color: #111;
  }
  .ws-tab-create.is-on .ws-tab-fab {
    outline: 2px solid var(--blue-hint);
    outline-offset: 2px;
  }
  .ws-kbd .ws-tabbar {
    transform: translateY(calc(100% + 1rem));
    pointer-events: none;
  }
  .ws-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ws-ease);
    z-index: 18;
  }
  .ws-nav-open .ws-backdrop { opacity: 1; pointer-events: auto; }
  .ws-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(300px, calc(100vw - 2.5rem));
    max-width: 100%;
    transform: translateX(-104%);
    transition: transform 0.28s var(--ws-ease);
    background: var(--surface);
    box-shadow: none;
    z-index: 20;
  }
  .ws-nav-open .ws-sidebar { transform: none; }
  .ws-nav-link {
    min-height: 44px;
  }
  .ws-form-row,
  .ws-choices { grid-template-columns: 1fr; }
  .ws-page,
  .ws-hero,
  .ws-hero-cta,
  .ws-hero-bar,
  .ws-section-head {
    flex-direction: column;
    align-items: stretch;
  }
  .ws-page-actions .btn,
  .ws-empty .btn {
    flex: 1 1 auto;
    min-height: 44px;
    justify-content: center;
  }
  .ws-body .btn {
    min-height: 44px;
    height: auto;
  }
  .ws-body .theme-toggle,
  .ws-scope-link {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .ws-scope select {
    height: 44px;
    max-width: 9.5rem;
    font-size: 16px;
  }
  .ws-field input,
  .ws-field textarea,
  .ws-field select,
  .ws-search {
    font-size: 16px;
    min-height: 44px;
  }
  .ws-search {
    height: 44px;
  }
  .ws-metrics {
    gap: 8px;
  }
  .ws-metric {
    padding: 0.8rem 0.75rem 0.85rem;
  }
  .ws-metric strong,
  .ws-metric-value {
    font-size: 1.08rem;
    letter-spacing: -0.03em;
  }
  .ws-modal-actions {
    flex-wrap: wrap;
  }
  .ws-modal-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .ws-table thead {
    display: none;
  }
  .ws-table,
  .ws-table tbody {
    display: block;
    width: 100%;
  }
  .ws-table tr {
    display: block;
    position: relative;
    padding: 0.85rem 1rem;
    margin-bottom: 0.65rem;
    border: 1px solid var(--ws-line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--ws-shadow);
  }
  .ws-table tbody tr:has(a[href]):hover {
    background: var(--nav-hover-bg);
  }
  .ws-table td {
    display: grid;
    grid-template-columns: 6.75rem minmax(0, 1fr);
    gap: 0.55rem 0.7rem;
    align-items: center;
    padding: 0.42rem 0;
    border: 0;
  }
  .ws-table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
  }
  .ws-table td:first-child {
    padding-top: 0;
  }
  .ws-table td:last-child {
    padding-bottom: 0;
  }
  .ws-toasts {
    left: max(0.75rem, env(safe-area-inset-left));
    right: max(0.75rem, env(safe-area-inset-right));
    width: auto;
    top: max(60px, calc(env(safe-area-inset-top) + 52px));
  }
}

@media (max-width: 900px) {
  .ws-metrics.is-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .ws-metrics,
  .ws-metrics.is-4 {
    grid-template-columns: 1fr;
  }
}

.set-layout {
  display: grid;
  gap: 1rem;
  max-width: 46rem;
}
.set-logo {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  align-items: start;
}
.set-logo-preview {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  border: 1px solid var(--ws-line);
  background: var(--paper-soft);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.set-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.set-logo-fields { min-width: 0; }
.set-pays {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 1rem;
  margin: 0.4rem 0 1rem;
}
.set-laxpay {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--ws-line, #e8e6e1);
}
.set-laxpay code {
  font-size: 0.86em;
}
@media (max-width: 640px) {
  .set-logo { grid-template-columns: 1fr; }
  .set-pays { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ws-content,
  .ws-stagger > *,
  .ws-tile,
  .ws-nav-link,
  .ws-sidebar,
  .ws-tabbar,
  .ws-toast,
  .ws-modal,
  .ws-modal-card,
  .ws-body .btn.is-busy::after,
  .ws-sidebar-brand img {
    animation: none !important;
    transition: none !important;
  }
}

.ws-toasts {
  position: fixed;
  top: max(68px, calc(env(safe-area-inset-top) + 56px));
  right: max(1.1rem, env(safe-area-inset-right));
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(360px, calc(100vw - 1.6rem - env(safe-area-inset-right)));
  pointer-events: none;
}

.ws-toast {
  pointer-events: auto;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  animation: ws-toast 0.35s var(--ws-ease) both;
}

.ws-toast.is-out {
  animation: ws-toast-out 0.28s var(--ws-ease) both;
}

.ws-toast-ok {
  background: var(--surface);
  border: 1px solid rgba(52, 117, 186, 0.22);
  color: var(--blue-hint);
}

.ws-toast-alert {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

body.ws-modal-open {
  overflow: hidden;
}

.ws-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 28%, rgba(8, 8, 10, 0.42));
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  opacity: 0;
  transition: opacity 0.32s var(--ws-ease);
}

.ws-modal.is-in {
  opacity: 1;
}

.ws-modal.is-out {
  opacity: 0;
}

.ws-modal-card {
  width: min(420px, 100%);
  padding: 1.3rem 1.35rem 1.2rem;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--ws-line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(28px) scale(0.94);
  opacity: 0;
  transition:
    transform 0.42s var(--ws-ease),
    opacity 0.32s var(--ws-ease),
    box-shadow 0.42s var(--ws-ease);
}

.ws-modal.is-in .ws-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.28),
    0 8px 24px rgba(0, 0, 0, 0.1);
}

.ws-modal.is-out .ws-modal-card {
  transform: translateY(14px) scale(0.97);
  opacity: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.ws-modal-card h2 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.03em;
  font-weight: 750;
}

.ws-modal-card p {
  margin: 0.45rem 0 1.15rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 500;
}

.ws-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

.ws-modal-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0.1rem auto 0.9rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--blue-hint) 16%, var(--surface));
  color: var(--blue-hint);
}

.ws-modal-mark .ws-ico {
  width: 24px;
  height: 24px;
}

.ws-modal-done .ws-modal-card {
  text-align: center;
  padding-top: 1.45rem;
}

.ws-modal-done .ws-modal-actions {
  justify-content: center;
}

.ws-modal-done .ws-modal-actions .btn {
  min-width: 8.5rem;
}

.ws-body .btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
}

.ws-body .btn-danger:hover {
  color: #fff;
  filter: brightness(1.06);
}
