:root {
  --forty-ink: #07111e;
  --forty-paper: #f4f0ea;
  --forty-cream: #fffdfa;
  --forty-gold: #dda94a;
  --forty-teal: #0a596c;
  --forty-muted: #667381;
  --forty-line: rgba(7, 17, 30, 0.13);
}

body.with-forty-context {
  padding-top: 86px;
}

body.with-forty-context.with-forty-assistance {
  padding-top: 128px;
}

body.forty-menu-open {
  overflow: hidden;
}

body[data-forty-module="gastronomia"].with-forty-context > .topbar .brand,
body[data-forty-module="gastronomia"].with-forty-context > .topbar .top-actions a[href="../../"],
body[data-forty-module="salud"].with-forty-context > .topbar .brand,
body[data-forty-module="salud"].with-forty-context > .topbar .top-actions,
body[data-forty-module="alquileres_temporarios"].with-forty-context #back-to-forty,
body[data-forty-module="club40"].with-forty-context .back-link,
body[data-forty-module="admin_forty"].with-forty-context .dashboard > .sidebar .brand,
body[data-forty-module="admin_forty"].with-forty-context .dashboard > .sidebar .workspace,
body[data-forty-module="admin_forty"].with-forty-context .dashboard > .sidebar .sign-out,
body[data-forty-module="admin_forty"].with-forty-context #active-context {
  display: none !important;
}

body.forty-context-blocked > main,
body.forty-context-blocked > .dashboard,
body.forty-context-blocked > .club-shell,
body.forty-context-blocked > .app-shell,
body.forty-context-blocked > .page-shell,
body.forty-context-blocked > .topbar {
  display: none !important;
}

body[data-forty-module="gastronomia"].with-forty-context > .topbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

body[data-forty-module="salud"].with-forty-context > .topbar {
  grid-template-columns: minmax(0, 1fr);
}

body[data-forty-module="gastronomia"].with-forty-context > .topbar::before {
  color: var(--forty-ink);
  content: "Gastronomía";
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.forty-context-shell {
  background: rgba(255, 253, 250, 0.94);
  border-bottom: 1px solid rgba(7, 17, 30, 0.12);
  box-shadow: 0 16px 45px rgba(7, 17, 30, 0.08);
  color: var(--forty-ink);
  font-family: Inter, "Avenir Next", Avenir, Arial, sans-serif;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 9998;
}

.forty-context-main {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr) minmax(240px, .65fr) auto;
  min-height: 76px;
  padding: 10px clamp(16px, 4vw, 56px);
}

.forty-context-brand,
.forty-context-nav-toggle,
.forty-context-workspace,
.forty-context-user button,
.forty-context-back,
.forty-context-sidebar a {
  font: inherit;
}

.forty-context-brand {
  align-items: center;
  color: var(--forty-ink);
  display: flex;
  font-size: 12px;
  font-weight: 900;
  gap: 9px;
  letter-spacing: .24em;
  text-decoration: none;
}

.forty-context-mark {
  border: 1.5px solid currentColor;
  border-radius: 50%;
  display: inline-block;
  height: 25px;
  position: relative;
  width: 25px;
}

.forty-context-mark::before,
.forty-context-mark::after {
  background: currentColor;
  content: "";
  position: absolute;
}

.forty-context-mark::before {
  height: 31px;
  left: 11px;
  top: -4px;
  width: 1px;
}

.forty-context-mark::after {
  height: 1px;
  left: -4px;
  top: 11px;
  width: 31px;
}

.forty-context-trail {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.forty-context-trail a,
.forty-context-label {
  color: var(--forty-ink);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.forty-context-trail > span {
  color: #8c96a2;
  font-size: 13px;
  font-weight: 900;
}

.forty-context-workspace {
  align-items: center;
  background: #f5f8fa;
  border: 1px solid var(--forty-line);
  border-radius: 999px;
  color: var(--forty-ink);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  gap: 8px;
  justify-self: stretch;
  min-height: 42px;
  min-width: 0;
  padding: 0 14px;
}

.forty-context-workspace span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forty-context-user {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: end;
  min-width: 0;
}

.forty-context-user-info {
  min-width: 0;
  text-align: right;
}

.forty-context-user-info strong,
.forty-context-user-info span {
  display: block;
  line-height: 1.2;
}

.forty-context-user-info strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forty-context-user-info span {
  color: var(--forty-muted);
  font-size: 12px;
  font-weight: 800;
}

.forty-context-user button,
.forty-context-nav-toggle,
.forty-context-back {
  background: var(--forty-ink);
  border: 0;
  border-radius: 999px;
  color: var(--forty-cream);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  min-height: 36px;
  padding: 0 13px;
  text-decoration: none;
}

.forty-personal-menu {
  position: relative;
}

.forty-personal-button {
  height: 38px;
  width: 38px;
}

.forty-personal-panel {
  background: var(--forty-cream);
  border: 1px solid var(--forty-line);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(7, 17, 30, 0.18);
  display: grid;
  min-width: 180px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
}

.forty-personal-panel[hidden] {
  display: none;
}

.forty-personal-panel button {
  background: transparent;
  color: var(--forty-ink);
  min-height: 36px;
  text-align: left;
}

.forty-personal-panel button:disabled {
  color: #8b96a1;
  cursor: default;
}

.forty-context-nav-toggle {
  display: none;
}

.forty-assistance-strip {
  align-items: center;
  background: #fff3d4;
  border-top: 1px solid rgba(221, 169, 74, 0.42);
  color: #694700;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 8px clamp(16px, 4vw, 56px);
}

.forty-assistance-strip strong {
  display: block;
  font-size: 13px;
}

.forty-assistance-strip span {
  font-size: 12px;
  font-weight: 800;
}

.forty-assistance-strip button {
  background: transparent;
  border: 1px solid rgba(105, 71, 0, 0.28);
  border-radius: 999px;
  color: #694700;
  cursor: pointer;
  font-weight: 900;
  min-height: 32px;
  padding: 0 12px;
}

.forty-context-sidebar {
  background: rgba(7, 17, 30, 0.96);
  bottom: 0;
  box-shadow: 20px 0 60px rgba(7, 17, 30, 0.24);
  color: var(--forty-cream);
  display: grid;
  gap: 8px;
  left: 0;
  max-width: 330px;
  padding: 20px;
  position: fixed;
  top: 86px;
  transform: translateX(-105%);
  transition: transform .18s ease;
  width: min(88vw, 330px);
  z-index: 9997;
}

.forty-context-sidebar.open {
  transform: translateX(0);
}

.forty-context-sidebar a {
  border-left: 3px solid transparent;
  border-radius: 10px;
  color: inherit;
  display: grid;
  font-size: 13px;
  font-weight: 900;
  gap: 3px;
  padding: 11px 12px;
  text-decoration: none;
}

.forty-context-sidebar a.active {
  border-left-color: var(--forty-gold);
  color: var(--forty-gold);
}

.forty-workspace-panel {
  background: rgba(7, 17, 30, 0.45);
  inset: 0;
  padding: 92px 18px 18px;
  position: fixed;
  z-index: 9999;
}

.forty-workspace-card {
  background: var(--forty-cream);
  border: 1px solid rgba(7, 17, 30, 0.12);
  border-radius: 18px;
  box-shadow: 0 28px 90px rgba(7, 17, 30, 0.22);
  color: var(--forty-ink);
  margin: 0 auto;
  max-height: calc(100vh - 120px);
  max-width: 760px;
  overflow: auto;
  padding: 22px;
}

.forty-workspace-head {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.forty-workspace-head h2 {
  font-size: 28px;
  margin: 0;
}

.forty-workspace-close {
  background: #edf2f5;
  border: 1px solid rgba(7, 17, 30, 0.1);
  border-radius: 999px;
  color: var(--forty-ink);
  cursor: pointer;
  font-weight: 900;
  min-height: 34px;
  padding: 0 12px;
}

.forty-workspace-group {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.forty-workspace-group > strong {
  color: #9b6d18;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.forty-workspace-option {
  background: #f7fafc;
  border: 1px solid rgba(7, 17, 30, 0.12);
  border-radius: 14px;
  color: var(--forty-ink);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 14px;
  text-align: left;
  width: 100%;
}

.forty-workspace-option.active {
  border-color: var(--forty-teal);
  box-shadow: inset 0 0 0 1px var(--forty-teal);
}

.forty-workspace-option b {
  font-size: 17px;
}

.forty-workspace-option span {
  color: var(--forty-muted);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 860px) {
  body.with-forty-context {
    padding-top: 204px;
  }

  body.with-forty-context.with-forty-assistance {
    padding-top: 252px;
  }

  .forty-context-main {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .forty-context-nav-toggle {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
  }

  .forty-context-brand {
    grid-column: 2;
    grid-row: 1;
  }

  .forty-context-trail {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .forty-context-workspace {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .forty-context-user {
    grid-column: 3;
    grid-row: 1;
    justify-content: space-between;
  }

  .forty-context-user-info {
    display: none;
  }

  .forty-context-sidebar {
    top: 0;
    z-index: 9999;
  }

  body.forty-menu-open::after {
    background: rgba(7, 17, 30, 0.54);
    content: "";
    inset: 0;
    position: fixed;
    z-index: 9996;
  }
}
